* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #efefef;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ====== LOGIN PAGE ====== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ====== FORM STYLES ====== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

/* Add styling for required field indicator */
.form-group label .required {
    color: var(--danger-color);
    margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: white;
    color: var(--text-primary);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: white;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ====== BUTTONS ====== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-large {
    padding: 14px 24px;
    width: 100%;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

/* ====== ADMIN LAYOUT ====== */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--secondary-color);
}

.admin-nav {
    width: 250px;
    background: white;
    padding: 20px;
    box-shadow: var(--shadow-md);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.nav-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.nav-header h2 {
    color: var(--primary-color);
    font-size: 20px;
}

.nav-menu {
    list-style: none;
}

.nav-link {
    display: block;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    margin-bottom: 8px;
    font-weight: 500;
    cursor: pointer;
}

.nav-link:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.nav-link.logout {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    color: var(--danger-color);
}

.admin-content {
    margin-left: 250px;
    flex: 1;
    padding: 30px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tab-header h1 {
    font-size: 24px;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ====== TABLES ====== */
.submissions-table,
.users-table {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

tbody tr:hover {
    background: #fafafa;
}

tbody tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ====== USER LAYOUT ====== */
.user-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--secondary-color);
}

.user-header {
    background: white;
    box-shadow: var(--shadow-sm);
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-header h1 {
    color: var(--text-primary);
    font-size: 24px;
}

/* Add styling for user info section with greeting and logout button */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-greeting {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

.form-container {
    flex: 1;
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.form-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-md);
}

.form-card h2 {
    font-size: 22px;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.form-section.hidden {
    display: none;
}

/* ====== MODALS ====== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-in;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.close:hover {
    color: var(--text-primary);
}

/* ====== SUCCESS MODAL ====== */
.success-content {
    text-align: center;
    padding: 50px 30px;
}

.success-icon {
    font-size: 60px;
    color: var(--success-color);
    margin-bottom: 20px;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.success-content h2 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.success-content p {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.success-content .note {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 25px;
}

/* ====== ERROR MESSAGE ====== */
.error-message {
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 15px;
    padding: 12px;
    background: #fef2f2;
    border-radius: var(--radius);
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    color: var(--success-color);
    font-size: 14px;
    margin-top: 15px;
    padding: 12px;
    background: #f0fdf4;
    border-radius: var(--radius);
    display: none;
}

.success-message.show {
    display: block;
}

/* ====== SEARCH BOX ====== */
.search-box {
    margin-bottom: 25px;
}

.search-form {
    display: flex;
    gap: 12px;
    align-items: center;
    background: white;
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.search-form input {
    flex: 1;
    min-width: 1000px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
}

.search-form input::placeholder {
    color: var(--text-secondary);
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-form .btn {
    padding: 10px 20px;
    font-size: 14px;
    white-space: nowrap;
}

.search-form .btn.btn-small {
    padding: 10px 16px;
}

/* ====== PAGINATION ====== */
.pagination {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-info {
    padding: 8px 16px;
    background: var(--secondary-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ====== DETAIL MODAL TABLE STYLING ====== */
.detail-modal-content {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.detail-header h2 {
    font-size: 22px;
    color: var(--text-primary);
    margin: 0;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table tr {
    border-bottom: 1px solid var(--border-color);
}

.detail-table tr:last-child {
    border-bottom: none;
}

.detail-table td {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.detail-table tr:last-child td {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--text-primary);
    width: 30%;
    vertical-align: top;
    padding-right: 15px;
}

.detail-table td:last-child {
    color: var(--text-secondary);
    width: 70%;
    word-break: break-word;
}

.detail-table .link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.detail-table .link:hover {
    text-decoration: underline;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-nav {
        width: 100%;
        height: auto;
        position: relative;
        display: flex;
        padding: 15px;
    }

    .nav-header {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        margin-right: 20px;
    }

    .nav-menu {
        display: flex;
        gap: 10px;
    }

    .nav-link {
        margin-bottom: 0;
        padding: 8px 12px;
        font-size: 12px;
    }

    .admin-content {
        margin-left: 0;
        padding: 15px;
    }

    .tab-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .form-container {
        padding: 20px 15px;
    }

    .form-card {
        padding: 20px;
    }

    .modal-content {
        width: 95%;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 10px;
    }

    /* Add responsive styles for user info section */
    .user-info {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .btn-outline {
        width: 100%;
    }

    /* ====== RESPONSIVE UPDATES ====== */
    .search-form {
        flex-wrap: wrap;
        gap: 10px;
    }

    .search-form input {
        min-width: 100%;
    }

    .search-form .btn {
        flex: 1;
        min-width: 100px;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .detail-label {
        width: 100%;
        padding-right: 0;
        margin-bottom: 5px;
        display: block;
    }

    .detail-table td {
        display: block;
        padding: 10px 0;
    }

    .detail-table tr {
        margin-bottom: 15px;
        border-bottom: 2px solid var(--border-color);
        display: block;
    }

    .pagination {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 25px;
    }

    .form-card {
        padding: 15px;
    }

    .btn {
        padding: 12px 16px;
    }
}
