/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    min-height: 100vh;
}

/* Header and Navigation */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

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

.logo img {
    height: 40px;
    width: auto;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: #333;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover {
    color: #007bff;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #007bff;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile Menu */
@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: 72px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 72px);
        background-color: #fff;
        padding: 1rem;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .main-nav.active {
        left: 0;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-link {
        display: block;
        padding: 0.75rem 0;
    }
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 80px auto 2rem;
    padding: 0 1rem;
    padding-top: 2rem;
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* Buttons */
.button {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
}

.button.primary {
    background-color: #007bff;
    color: #fff;
}

.button.primary:hover {
    background-color: #0056b3;
}

.button.secondary {
    background-color: #6c757d;
    color: #fff;
}

.button.secondary:hover {
    background-color: #545b62;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    table-layout: fixed;
}

.table th,
.table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    word-break: break-word;
    overflow-wrap: break-word;
}

.table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

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

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer */
footer {
    background-color: #333;
    color: #fff;
    padding: 1rem 0;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

/* Profile Section */
.profile-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.profile-header h2 {
    margin: 0;
    color: #333;
}

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

.profile-item {
    display: flex;
    flex-direction: column;
}

.profile-item label {
    font-weight: 600;
    color: #666;
    margin-bottom: 0.25rem;
}

.profile-item span {
    color: #333;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Existing styles */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --error-color: #dc2626;
    --success-color: #16a34a;
    --background-color: #f3f4f6;
    --card-background: #ffffff;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--background-color);
    padding: 2rem;
}

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

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    color: #333;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

.required::after {
    content: "*";
    color: #dc3545;
    margin-left: 0.25rem;
}

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

button {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--primary-hover);
}

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

@media (max-width: 640px) {
    body {
        padding: 1rem;
    }
    
    .container {
        padding: 1rem;
    }
}

/* Users list */
.users-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.user-card {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.user-card h2 {
    color: var(--text-color);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.user-card p {
    color: #6b7280;
    margin-bottom: 0.5rem;
}

/* User actions */
.user-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.button.edit {
    background-color: #3498db;
    color: white;
}

.button.edit:hover {
    background-color: #2980b9;
}

.button.delete {
    background-color: #e74c3c;
    color: white;
}

.button.delete:hover {
    background-color: #c0392b;
}

.button.primary {
    background-color: #2ecc71;
    color: white;
}

.button.primary:hover {
    background-color: #27ae60;
}

.button.secondary {
    background-color: #95a5a6;
    color: white;
}

.button.secondary:hover {
    background-color: #7f8c8d;
}

/* Current photo indicator */
.current-photo {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
}

.current-photo p {
    margin-bottom: 0.5rem;
    color: #4b5563;
    font-weight: 500;
}

.current-photo img {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Login form */
.login-form {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.login-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.login-form input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.login-form .form-actions {
    text-align: center;
    margin-top: 2rem;
}

/* Roles list */
.roles-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.role-card {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.role-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.role-card h2 {
    color: var(--text-color);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.role-card p {
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.role-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Profile styles */
.profile-section {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.profile-header h2 {
    color: var(--text-color);
    font-size: 1.25rem;
    margin: 0;
}

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

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-group label {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

.info-group p {
    color: var(--text-color);
    margin: 0;
    font-size: 1rem;
}

.profile-photo {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.password-form {
    max-width: 400px;
    margin: 0 auto;
}

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

.password-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #4b5563;
    font-weight: 500;
}

.password-form input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
}

.password-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.password-form .form-actions {
    margin-top: 1.5rem;
    text-align: center;
}

/* Alert styles */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert.info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    width: 100%;
    background-color: #fff;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    margin-right: 1rem;
}

.nav-logo {
    height: 40px;
    width: auto;
    max-height: 40px;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-grow: 1;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #333;
    text-decoration: none;
    padding: 0.5rem 1rem;
    display: block;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #007bff;
}

.nav-item .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-width: 200px;
    z-index: 1000;
}

.nav-item:hover .submenu {
    display: block;
}

.nav-item .submenu a {
    color: #333;
    text-decoration: none;
    padding: 0.5rem 1rem;
    display: block;
    transition: background-color 0.3s;
}

.nav-item .submenu a:hover {
    background-color: #f8f9fa;
}

.menu-button {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.75rem;
    color: #333;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.menu-button:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.menu-button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.menu-button.active {
    background-color: #007bff;
    color: #fff;
}

/* Mobile styles */
@media (max-width: 1024px) {
    .nav {
        justify-content: flex-start;
        position: relative;
        z-index: 10000;
        min-height: 60px;
        padding: 0.75rem 1rem;
    }
    
    .menu-button {
        display: block;
        order: 1;
        z-index: 10001;
        position: relative;
    }
    
    .logo-container {
        order: 2;
        margin-left: 1rem;
        margin-right: auto;
    }

    .nav-list {
        display: none;
        position: fixed;
        top: 85px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ffffff;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        flex-direction: column;
        order: 3;
        z-index: 9999;
        overflow-y: auto;
        padding: 0;
    }

    .nav-list.active {
        display: flex;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-item:first-child {
        border-top: 1px solid #f0f0f0;
        padding-top: 0.5rem;
    }

    .nav-link {
        padding: 1.25rem 1.5rem;
        color: #333;
        font-weight: 500;
        border: none;
        background: #ffffff;
        display: block;
        text-decoration: none;
    }

    .nav-link:hover {
        background-color: #f8f9fa;
        color: #007bff;
        text-decoration: none;
    }

    .nav-item .submenu {
        position: static;
        box-shadow: none;
        background-color: #f8f9fa;
        z-index: 9998;
        border-top: 1px solid #e9ecef;
        margin: 0;
    }

    .nav-item.active .submenu {
        display: block;
    }

    .nav-item .submenu a {
        padding: 1rem 2.5rem;
        color: #555;
        font-weight: normal;
        border-bottom: 1px solid #e9ecef;
        background-color: #f8f9fa;
        display: block;
        text-decoration: none;
    }

    .nav-item .submenu a:hover {
        background-color: #e9ecef;
        color: #007bff;
        text-decoration: none;
    }
}

/* User List Styles */
.table-responsive {
    margin-top: 20px;
    width: 100%;
}

@media (max-width: 1200px) {
    .table-responsive {
        overflow-x: auto;
    }
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    table-layout: fixed;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    word-break: break-word;
    overflow-wrap: break-word;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

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

.badge {
    display: inline-block;
    padding: 4px 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    font-size: 0.85em;
    margin: 2px;
    color: #495057;
}

.action-buttons {
    display: flex;
    gap: 3px;
    justify-content: flex-start;
    min-width: 100px;
}

.button.small {
    padding: 3px 6px;
    font-size: 0.9em;
    min-width: 28px;
    text-align: center;
}

/* User Detail Styles */
.user-detail {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    margin-top: 20px;
}

.detail-section {
    margin-bottom: 30px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h2 {
    color: #495057;
    font-size: 1.2em;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item label {
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.detail-item span {
    color: #212529;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.photo-item {
    text-align: center;
}

.photo-item h3 {
    font-size: 1em;
    color: #6c757d;
    margin-bottom: 8px;
}

.photo-item img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-actions h1 {
    margin: 0;
}

/* Form Configuration Styles */
.form-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    margin-top: 20px;
}

.form-section {
    margin-bottom: 30px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section h2 {
    color: #495057;
    font-size: 1.2em;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    margin: 0;
}

.field-item {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.field-header h3 {
    margin: 0;
    color: #495057;
    font-size: 1.1em;
}

.field-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.options-group {
    grid-column: 1 / -1;
}

.options-group textarea {
    min-height: 100px;
    font-family: monospace;
}

/* Form Preview Styles */
.form-preview {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    margin-top: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.form-preview h2 {
    color: #495057;
    margin-bottom: 20px;
}

.form-preview .form-group {
    margin-bottom: 20px;
}

.form-preview label {
    display: block;
    margin-bottom: 5px;
    color: #495057;
    font-weight: 500;
}

.form-preview input[type="text"],
.form-preview input[type="number"],
.form-preview select,
.form-preview textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1em;
}

.form-preview input[type="checkbox"],
.form-preview input[type="radio"] {
    margin-right: 8px;
}

.form-preview .checkbox-group,
.form-preview .radio-group {
    margin: 5px 0;
}

.form-preview .required::after {
    content: "*";
    color: #dc3545;
    margin-left: 4px;
} 