/* Authentication Pages Styles */

.auth-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    margin: 0 auto;
}

.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 40px;
    animation: slideUp 0.3s ease-out;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: #2d3748;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.auth-header p {
    color: #718096;
    font-size: 16px;
    margin: 0;
}

.auth-form {
    width: 100%;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #2d3748;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #fff;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:invalid {
    border-color: #e53e3e;
}

.form-group input[readonly] {
    background-color: #f7fafc;
    color: #718096;
}

.form-help {
    display: block;
    margin-top: 4px;
    color: #718096;
    font-size: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
    box-sizing: border-box;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-full {
    width: 100%;
}

.auth-links {
    margin-top: 24px;
    text-align: center;
}

.auth-links .link {
    display: block;
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.auth-links .link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.error-message {
    background-color: #fed7d7;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
    animation: shake 0.3s ease-in-out;
}

.success-message {
    background-color: #c6f6d5;
    border: 1px solid #9ae6b4;
    color: #276749;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Loading state */
.btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 16px 20px;
    margin-bottom: 12px;
    border-left: 4px solid #48bb78;
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
}

.toast.error {
    border-left-color: #e53e3e;
}

.toast.warning {
    border-left-color: #ed8936;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== MAIN APP AUTHENTICATION STYLES ===== */

/* Header Authentication Elements */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.auth-buttons .btn {
    padding: 8px 16px;
    min-height: auto;
    font-size: 14px;
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.user-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    line-height: 1.2;
}

.user-role {
    font-size: 12px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.user-dropdown-btn:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.dropdown-arrow {
    font-size: 10px;
    color: #718096;
    transition: transform 0.2s ease;
}

.user-dropdown-btn[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 8px;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #4a5568;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f7fafc;
    color: #2d3748;
}

.dropdown-item.logout {
    color: #e53e3e;
}

.dropdown-item.logout:hover {
    background: #fed7d7;
    color: #c53030;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

/* Login Status Badge - Removed for cleaner UI */

/* User Layouts Section */
.user-layouts {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.user-layouts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-layout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f7fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.layout-name {
    font-size: 13px;
    color: #4a5568;
    font-weight: 500;
}

.layout-hint {
    font-size: 12px;
    color: #718096;
    font-style: italic;
    text-align: center;
    margin-top: 12px;
}

/* Admin Panel Styles */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}

.admin-table th,
.admin-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
}

.role-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.admin {
    background: #fed7d7;
    color: #c53030;
}

.role-badge.user {
    background: #c6f6d5;
    color: #276749;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    padding: 12px 16px;
    background: none;
    border: none;
    color: #718096;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.layout-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

/* Responsive design */
@media (max-width: 768px) {
    .user-info {
        display: none;
    }
    
    .user-dropdown-menu {
        right: auto;
        left: 0;
        min-width: 180px;
    }
    
    .auth-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .auth-buttons .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 16px;
    }
    
    .auth-card {
        padding: 24px;
    }
    
    .auth-header h1 {
        font-size: 20px;
    }
    
    .auth-header p {
        font-size: 14px;
    }
    
    .header-right {
        gap: 8px;
    }
} 