/* Mobile-First Responsive Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --brand-green: #7EBD5A;
    --brand-green-dark: #6AAA47;
    --brand-green-light: #A8D88E;

    --primary-color: #7EBD5A;
    --primary-hover: #6AAA47;
    --secondary-color: #5A9BD5;
    --secondary-hover: #4A7DB8;
    --danger-color: #E85D5D;
    --danger-hover: #D44848;

    --embroidery-color: #9C7BBF;
    --embroidery-light: #E5D9F2;
    --screenprint-color: #5A9BD5;
    --screenprint-light: #D1E7F9;
    --vinyl-color: #7EBD5A;
    --vinyl-light: #DFF0D8;

    --text-dark: #2c3e50;
    --text-medium: #555;
    --text-light: #7f8c8d;
    --border-color: #e0e0e0;
    --background: #f8f9fa;
    --card-background: #ffffff;

    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #7EBD5A 0%, #5A9370 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 24px;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Headers */
.logo-header {
    text-align: center;
    margin-bottom: 24px;
}

.logo-header img {
    max-width: 200px;
    height: auto;
    margin: 0 auto 16px;
    display: block;
}

h1 {
    font-size: 32px;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 16px;
    margin-bottom: 32px;
}

h2 {
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 20px;
    font-weight: 600;
}

/* Forms - Mobile Optimized */
.form-group {
    margin-bottom: 28px;
}

label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
    letter-spacing: 0.2px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 16px 18px;
    font-size: 17px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    background-color: var(--card-background);
    font-family: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(126, 189, 90, 0.15);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: #aaa;
}

/* Department Tiles */
.department-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.department-tile {
    position: relative;
    padding: 24px 16px;
    background: var(--card-background);
    border: 3px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.department-tile:active {
    transform: scale(0.97);
}

.department-tile.selected {
    border-color: currentColor;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.15);
}

.department-tile .icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
    filter: grayscale(0.5);
    transition: var(--transition);
}

.department-tile.selected .icon {
    filter: grayscale(0);
    transform: scale(1.1);
}

.department-tile .label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    transition: var(--transition);
}

.department-tile.embroidery {
    color: var(--embroidery-color);
}

.department-tile.embroidery.selected {
    background: var(--embroidery-light);
}

.department-tile.screenprint {
    color: var(--screenprint-color);
}

.department-tile.screenprint.selected {
    background: var(--screenprint-light);
}

.department-tile.vinyl {
    color: var(--vinyl-color);
}

.department-tile.vinyl.selected {
    background: var(--vinyl-light);
}

/* Photo Selection Buttons */
.photo-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.photo-btn {
    position: relative;
    padding: 28px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.photo-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: var(--transition);
}

.photo-btn:hover::before {
    opacity: 1;
}

.photo-btn:active {
    transform: translateY(2px);
    box-shadow: var(--shadow-sm);
}

.photo-btn .icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}

.photo-btn.camera {
    background: linear-gradient(135deg, #7EBD5A 0%, #6AAA47 100%);
}

.photo-btn.library {
    background: linear-gradient(135deg, #5A9BD5 0%, #4A7DB8 100%);
}

input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Buttons - Large and Touch-Friendly */
.btn {
    display: block;
    width: 100%;
    padding: 18px 24px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    margin-top: 10px;
    font-family: inherit;
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #388E3C 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #1565C0 100%);
    color: white;
}

.btn-secondary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #C62828 100%);
    color: white;
}

.btn-danger:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-small {
    padding: 10px 20px;
    font-size: 15px;
    width: auto;
    display: inline-block;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Messages */
.message {
    padding: 16px 18px;
    margin-bottom: 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    text-align: center;
    border-left: 4px solid;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #28a745;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #17a2b8;
}

/* Selected Files Display */
.selected-files {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #f0f8ff 0%, #e8f5e9 100%);
    border-radius: var(--radius-md);
    font-size: 15px;
    border: 2px dashed var(--primary-color);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.selected-files strong {
    color: var(--text-dark);
    display: block;
    margin-bottom: 8px;
}

.selected-files ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.selected-files li {
    padding: 8px 12px;
    margin: 4px 0;
    background: white;
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.selected-files li::before {
    content: '📎';
    font-size: 16px;
}

/* Admin Dashboard Styles */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.admin-header h1 {
    margin-bottom: 4px;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.admin-tab {
    padding: 12px 24px;
    text-decoration: none;
    color: var(--text-medium);
    font-weight: 600;
    font-size: 16px;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.admin-tab:hover {
    color: var(--primary-color);
    background: rgba(126, 189, 90, 0.05);
}

.admin-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.submissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.submission-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.submission-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.submission-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #f0f0f0;
}

.submission-info {
    padding: 15px;
}

.submission-name {
    font-size: 18px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.submission-date {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.submission-size {
    font-size: 14px;
    color: #95a5a6;
    margin-bottom: 10px;
}

.submission-department {
    font-size: 14px;
    color: #3498db;
    font-weight: 500;
    margin-bottom: 15px;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 50px auto;
}

/* Table for smaller screens */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #4CAF50;
    color: white;
    font-weight: 600;
}

tr:hover {
    background-color: #f5f5f5;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .container {
        padding: 20px 15px;
    }

    h1 {
        font-size: 24px;
    }

    .admin-header {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-header .btn {
        margin-top: 10px;
    }

    .submissions-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,.1);
    border-radius: 50%;
    border-top-color: #4CAF50;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Instructions - Removed for cleaner UI */

/* Accessibility improvements */
:focus {
    outline: 3px solid var(--brand-green);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Image Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
    padding: 0 10px;
}

.modal-close:hover {
    color: var(--brand-green);
    transform: rotate(90deg);
}

.modal-footer {
    background: white;
    padding: 20px;
    border-radius: var(--radius-md);
    margin-top: 16px;
    text-align: center;
    min-width: 300px;
}

.modal-footer p {
    margin: 0 0 16px 0;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 16px;
}

/* User Management Table */
.users-table {
    width: 100%;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-top: 20px;
}

.users-table table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th {
    background: var(--brand-green);
    color: white;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 15px;
}

.users-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 15px;
}

.users-table tr:last-child td {
    border-bottom: none;
}

.users-table tr:hover {
    background: rgba(126, 189, 90, 0.05);
}

.user-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--brand-green-light);
    color: var(--brand-green-dark);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Responsive table */
@media (max-width: 768px) {
    .users-table {
        overflow-x: auto;
    }

    .action-buttons {
        flex-direction: column;
    }

    .admin-tabs {
        overflow-x: auto;
    }
}