* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Expired upload styling */
.expired-upload {
    opacity: 0.6;
    background-color: #f9f9f9;
}

.expired-badge {
    background-color: #e74c3c;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: bold;
    margin-left: 8px;
}

.btn-small[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #ccc;
}

.upload-name-link {
    color: #2c3e50;
    text-decoration: none;
}

.upload-name-link:hover {
    color: #3498db;
    text-decoration: underline;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.file-preview {
    font-size: 0.9em;
    max-height: 120px;
    overflow-y: auto;
}

.file-preview div {
    padding: 2px 0;
    border-bottom: 1px solid #eee;
}

.file-preview div:last-child {
    border-bottom: none;
}

.file-preview em {
    color: #666;
    font-size: 0.8em;
}

.upload-subtitle {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

.navbar {
    background: white;
    color: rgb(17, 44, 64);
    padding: 1.5rem 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-bottom: 3px solid rgb(37, 204, 196);
    position: relative;
}

.logo-link {
    color: rgb(17, 44, 64);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.navbar-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

.logo-link:hover {
    color: rgb(37, 204, 196);
    text-decoration: none;
    transform: none;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-container h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    line-height: 1;
}

.nav-menu {
    display: flex;
    gap: 1rem;
}

.nav-menu a {
    color: rgb(17, 44, 64);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 2px solid transparent;
}

.nav-menu a:hover {
    background-color: rgb(37, 204, 196);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 204, 196, 0.3);
}

/* Mobile hamburger menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.mobile-menu-toggle:hover {
    background-color: rgba(37, 204, 196, 0.1);
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background-color: rgb(17, 44, 64);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Files list styling */
.files-list {
    margin-top: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.file-item:last-child {
    border-bottom: none;
}

.file-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.filename {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.filesize {
    font-size: 0.875rem;
    color: #6c757d;
}

.btn-small {
    padding: 0.5rem 1rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.3s;
}

.btn-small:hover {
    background-color: #0056b3;
}

.download-single {
    margin-left: 1rem;
}

.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.messages {
    margin-bottom: 2rem;
}

.alert {
    padding: 1rem;
    background: #e74c3c;
    color: white;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.login-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
    resize: vertical;
}

.form-group textarea {
    min-height: 50px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, rgb(17, 44, 64) 0%, rgb(37, 204, 196) 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(37, 204, 196, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 204, 196, 0.4);
    background: linear-gradient(135deg, rgb(37, 204, 196) 0%, rgb(17, 44, 64) 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #666 0%, #888 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #888 0%, #666 100%);
}

.btn-cancel {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
    background: linear-gradient(135deg, #c82333 0%, #dc3545 100%);
}

.btn-small {
    background: linear-gradient(135deg, rgb(17, 44, 64) 0%, rgb(37, 204, 196) 100%);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-right: 0.5rem;
}

/* Checkbox styling */
.form-group label input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    accent-color: rgb(37, 204, 196);
    transform: scale(1.2);
}

.form-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 204, 196, 0.3);
    background: linear-gradient(135deg, rgb(37, 204, 196) 0%, rgb(17, 44, 64) 100%);
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.login-info {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e8ed;
    font-size: 0.9rem;
    color: #666;
}

.dashboard-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    padding: 20px;
}

.dashboard-header {
    background: #2c3e50;
    color: white;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-badge {
    background: #e74c3c;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.upload-section {
    padding: 2rem;
    border-bottom: 1px solid #e1e8ed;
}

.upload-box {
    border: 3px dashed rgba(37, 204, 196, 0.5);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8f9fa;
}

.upload-box:hover,
.upload-box.dragover {
    border-color: rgb(37, 204, 196);
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 204, 196, 0.2);
}

.upload-content .upload-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: rgb(37, 204, 196);
}

.upload-content h3 {
    color: rgb(17, 44, 64);
    margin-bottom: 1rem;
    font-weight: 600;
}

.upload-options {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e1e8ed;
}

.upload-progress {
    padding: 2rem 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 1rem 0;
    position: relative;
    z-index: 1000;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(17, 44, 64, 0.1);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgb(37, 204, 196), rgb(45, 224, 216));
    transition: width 0.3s ease;
    width: 0%;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(37, 204, 196, 0.3);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 35%, 
        rgba(255,255,255,0.2) 50%, 
        transparent 65%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: rgb(17, 44, 64);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.files-section {
    padding: 2rem;
}

.files-section h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.files-table {
    overflow-x: auto;
}

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

.files-table th,
.files-table td {
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 2px solid rgba(37, 204, 196, 0.2);
}

.files-table tbody tr:hover {
    background: rgba(37, 204, 196, 0.1);
    transform: translateX(4px);
    transition: all 0.3s ease;
}

.files-table th {
    background: rgb(17, 44, 64);
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.link-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.link-container input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
}

.link-container button {
    padding: 0.5rem 1rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.admin-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #3498db;
}

.stat-card h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.stat-card p {
    color: #666;
    font-size: 0.9rem;
}

.admin-sections {
    display: grid;
    gap: 2rem;
}

.admin-section {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

.admin-section h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.settings-form,
.user-form {
    max-width: none;
}

.users-table {
    overflow-x: auto;
    margin-top: 1rem;
}

.users-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 4px;
    overflow: hidden;
}

.users-table th,
.users-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

.users-table th {
    background: #2c3e50;
    color: white;
    font-weight: 600;
}

.users-table tr:hover {
    background: #f8f9fa;
}

.download-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.download-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 3rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.download-header {
    margin-bottom: 2rem;
}

.download-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.download-header h2 {
    color: #2c3e50;
}

.file-info {
    margin-bottom: 2rem;
    text-align: left;
}

.file-info h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.file-size {
    color: #666;
    font-size: 0.9rem;
}

.message-box {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #3498db;
    margin-top: 1rem;
}

.message-box h4 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.password-section {
    margin-bottom: 2rem;
}

.download-actions {
    margin-bottom: 2rem;
}

.download-info {
    color: #666;
    font-size: 0.9rem;
}

.selected-files {
    margin: 1rem 0;
    text-align: left;
}

.file-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: #f8f9fa;
    margin: 0.25rem 0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.upload-success {
    text-align: center;
    padding: 2rem;
}

.upload-success .upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-success h3 {
    color: #27ae60;
    margin-bottom: 1rem;
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-menu-toggle {
        display: flex;
        order: 2;
    }
    
    .logo-link {
        order: 1;
    }
    
    .nav-menu {
        position: absolute;
        top: calc(100% + 1.5rem);
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        flex-direction: column;
        gap: 0;
        padding: 0;
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
        order: 3;
        width: 100%;
        border-radius: 8px;
        overflow: hidden;
        margin: 0 1rem;
        right: 1rem;
        left: 1rem;
        width: auto;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu a {
        padding: 1rem 2rem;
        border-bottom: 1px solid #f0f0f0;
        transition: background-color 0.3s ease;
        text-align: left;
        width: 100%;
        border-radius: 0;
    }
    
    .nav-menu a:last-child {
        border-bottom: none;
    }
    
    .nav-menu a:hover {
        background-color: rgba(37, 204, 196, 0.1);
        transform: none;
        box-shadow: none;
        color: rgb(17, 44, 64);
    }
    
    .navbar-logo {
        height: 60px;
    }
    
    .main-content {
        padding: 0 1rem;
        margin: 1rem auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .upload-box {
        padding: 2rem 1rem;
        margin: 1rem 0;
    }
    
    .upload-content h3 {
        font-size: 1.2rem;
    }
    
    .upload-icon {
        font-size: 2.5rem !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .download-card {
        padding: 2rem 1rem;
        margin: 1rem;
    }
    
    .admin-container {
        padding: 1rem;
        margin: 1rem;
    }
    
    .admin-section {
        padding: 1rem;
    }
    
    .dashboard-container {
        padding: 15px;
        margin: 1rem 0;
    }
    
    .dashboard-header {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .upload-section {
        padding: 1.5rem;
    }
    
    .files-section {
        padding: 1.5rem;
    }
    
    /* Mobile table improvements */
    .files-table {
        font-size: 0.85rem;
    }
    
    .files-table th,
    .files-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .files-table th {
        font-size: 0.8rem;
    }
    
    /* Mobile forms */
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Mobile file items */
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .file-details {
        width: 100%;
    }
    
    .download-single {
        margin-left: 0;
        margin-top: 0.5rem;
        align-self: stretch;
    }
    
    /* Mobile modals */
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    /* Mobile login */
    .login-container {
        padding: 1rem;
    }
    
    .login-form {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    /* Mobile templates grid */
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .template-card {
        padding: 1rem;
    }
    
    .template-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .template-actions {
        align-self: stretch;
        justify-content: space-between;
    }
    
    /* Mobile progress */
    .upload-progress {
        padding: 1.5rem 1rem;
        margin: 1rem 0;
    }
    
    .progress-text {
        font-size: 1rem;
    }
    
    /* Mobile link container */
    .link-container {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .link-container input {
        width: 100%;
    }
    
    .link-container button {
        width: 100%;
        padding: 0.75rem;
    }
    
    /* Page header mobile */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .btn-add-template {
        width: 100%;
        text-align: center;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .navbar {
        padding: 1rem 0;
    }
    
    .nav-container {
        padding: 0 0.75rem;
    }
    
    .navbar-logo {
        height: 50px;
    }
    
    .nav-menu a {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    
    .main-content {
        padding: 0 0.75rem;
    }
    
    .upload-box {
        padding: 1.5rem 0.75rem;
    }
    
    .upload-content h3 {
        font-size: 1.1rem;
    }
    
    .upload-icon {
        font-size: 2rem !important;
    }
    
    .dashboard-container,
    .admin-container,
    .download-card,
    .login-form {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .dashboard-header {
        padding: 1rem;
    }
    
    .upload-section,
    .files-section {
        padding: 1rem;
    }
    
    .files-table th,
    .files-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-small {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .modal-content {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .template-card {
        padding: 0.75rem;
    }
    
    .progress-text {
        font-size: 0.9rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
}

/* Email Autocomplete Styles */
.autocomplete-active {
    background-color: #e3f2fd !important;
}

.autocomplete-list div:hover {
    background-color: #f5f5f5;
}

/* Modern Email Templates Styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e1e8ed;
}

.page-header h1 {
    margin: 0;
    color: #1a1a1a;
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.btn-add-template {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-template:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.help-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.help-card h3 {
    margin: 0 0 1rem 0;
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
}

.shortcode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
}

.shortcode-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shortcode-item code {
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.shortcode-item span {
    color: #6b7280;
    font-size: 0.875rem;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.template-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.template-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.template-info h3 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 600;
}

.default-badge {
    background: #10b981;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.template-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: 1px solid #d1d5db;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

.btn-edit:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.btn-delete:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.template-field {
    margin-bottom: 1rem;
}

.template-field label {
    display: block;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.field-content {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.75rem;
    color: #1f2937;
    font-size: 0.875rem;
    line-height: 1.4;
}

.template-body {
    max-height: 6rem;
    overflow-y: auto;
    white-space: pre-line;
}

.template-meta {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    color: #6b7280;
    font-size: 0.8rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.empty-icon {
    margin-bottom: 1rem;
    color: #d1d5db;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: #374151;
    font-size: 1.125rem;
    font-weight: 600;
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Touch devices */
    .btn-primary,
    .btn-secondary,
    .btn-cancel,
    .btn-small,
    .nav-menu a {
        min-height: 44px; /* iOS recommended minimum touch target */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .files-table tr {
        cursor: pointer;
    }
    
    .files-table tr:hover {
        transform: none; /* Remove transform on touch devices */
        background: rgba(37, 204, 196, 0.1);
    }
    
    .upload-box:hover {
        transform: none; /* Remove transform on touch devices */
    }
    
    .btn-primary:hover,
    .btn-secondary:hover,
    .btn-cancel:hover,
    .btn-small:hover {
        transform: none; /* Remove hover transforms on touch devices */
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar-logo {
        height: 40px;
    }
    
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        flex-direction: column;
        padding: 0.5rem 0;
    }
    
    .nav-menu a {
        padding: 0.75rem 2rem;
        font-size: 0.9rem;
    }
    
    .dashboard-header {
        padding: 1rem;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .upload-section {
        padding: 1rem;
    }
    
    .upload-box {
        padding: 1.5rem 1rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .navbar-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark mode support (if device prefers dark mode) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e5e5e5;
    }
    
    .navbar {
        background: #2d2d2d;
        color: #e5e5e5;
        border-bottom-color: rgb(37, 204, 196);
    }
    
    .logo-link {
        color: #e5e5e5;
    }
    
    .nav-menu a {
        color: #e5e5e5;
    }
    
    .nav-menu {
        background: #2d2d2d;
    }
    
    .nav-menu a:hover {
        background-color: rgba(37, 204, 196, 0.2);
    }
    
    .hamburger-line {
        background-color: #e5e5e5;
    }
    
    .mobile-menu-toggle:hover {
        background-color: rgba(37, 204, 196, 0.2);
    }
    
    .dashboard-container,
    .admin-container,
    .download-card,
    .login-form,
    .template-card {
        background: #2d2d2d;
        color: #e5e5e5;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        background: #3d3d3d;
        border-color: #555;
        color: #e5e5e5;
    }
    
    .upload-box {
        background: #2d2d2d;
        border-color: rgba(37, 204, 196, 0.5);
    }
    
    .upload-box:hover,
    .upload-box.dragover {
        background: #3d3d3d;
    }
    
    .files-table th {
        background: #1a1a1a;
    }
    
    .files-table tr:hover {
        background: rgba(37, 204, 196, 0.2);
    }
    
    .modal {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .modal-content {
        background: #2d2d2d;
        color: #e5e5e5;
    }
}

/* Accessibility improvements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus improvements for keyboard navigation */
*:focus {
    outline: 2px solid rgb(37, 204, 196);
    outline-offset: 2px;
}

.btn-primary:focus,
.btn-secondary:focus,
.btn-cancel:focus,
.btn-small:focus {
    outline: 3px solid rgba(37, 204, 196, 0.5);
    outline-offset: 2px;
}

/* Skip link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: rgb(37, 204, 196);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
}

.skip-link:focus {
    top: 6px;
}

/* Tablet improvements */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-container {
        padding: 0 1.5rem;
    }
    
    .main-content {
        padding: 0 1.5rem;
    }
    
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-container {
        padding: 1.5rem;
    }
}

/* Large tablet and small desktop */
@media (min-width: 1025px) and (max-width: 1200px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Prevent horizontal scrolling on small screens */
body {
    overflow-x: hidden;
}

.main-content,
.nav-container,
.dashboard-container,
.admin-container {
    max-width: 100%;
    overflow-x: auto;
}

/* Improve table responsiveness */
@media (max-width: 768px) {
    .files-table table {
        min-width: 100%;
        font-size: 0.8rem;
    }
    
    .users-table table {
        min-width: 100%;
        font-size: 0.8rem;
    }
    
    /* Stack table cells on very small screens */
    @media (max-width: 480px) {
        .files-table thead {
            display: none;
        }
        
        .files-table tr {
            display: block;
            border: 1px solid #e1e8ed;
            margin-bottom: 1rem;
            border-radius: 8px;
            background: white;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        
        .files-table td {
            display: block;
            text-align: left;
            border: none;
            padding: 0.75rem;
            border-bottom: 1px solid #f0f0f0;
        }
        
        .files-table td:last-child {
            border-bottom: none;
        }
        
        .files-table td:before {
            content: attr(data-label) ": ";
            font-weight: bold;
            color: #666;
        }
    }
}

/* Notification improvements for mobile */
@media (max-width: 768px) {
    .notification {
        right: 10px !important;
        left: 10px !important;
        top: 10px !important;
        transform: translateY(-100%) !important;
    }
    
    .notification.show {
        transform: translateY(0) !important;
    }
}

/* Print styles */
@media print {
    .navbar,
    .nav-menu,
    .btn-primary,
    .btn-secondary,
    .btn-cancel,
    .btn-small,
    .upload-box,
    .upload-options {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .progress-fill::after {
        animation: none;
    }
}