/* Rooche Digital Brand Styles */
:root {
    --rooche-red: #e52334;
    --rooche-dark: #23262f;
    --rooche-white: #ffffff;
    --rooche-light-gray: #f8f9fa;
    --rooche-border-gray: #e5e7eb;
}

/* Base Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    background: linear-gradient(135deg, var(--rooche-white) 0%, var(--rooche-light-gray) 100%);
    color: var(--rooche-dark);
    line-height: 1.6;
}

.rooche-logo {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

/* Brand Colors */
.rooche-red {
    color: var(--rooche-red);
}

.rooche-dark {
    color: var(--rooche-dark);
}

.bg-rooche-red {
    background-color: var(--rooche-red);
}

.bg-rooche-dark {
    background-color: var(--rooche-dark);
}

.border-rooche-red {
    border-color: var(--rooche-red);
}

/* Focus States */
.focus\:ring-rooche-red:focus {
    --tw-ring-color: var(--rooche-red);
}

.focus\:border-rooche-red:focus {
    border-color: var(--rooche-red);
}

.hover\:bg-rooche-red:hover {
    background-color: var(--rooche-red);
}

/* Logo Styles */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.logo-image {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.logo-text {
    font-size: 24px;
    font-weight: 600;
    color: var(--rooche-dark);
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 28rem;
    padding: 2rem;
    background: var(--rooche-white);
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--rooche-border-gray);
}

/* Brand Accent Line */
.brand-accent {
    width: 4rem;
    height: 0.25rem;
    background-color: var(--rooche-red);
    border-radius: 9999px;
    margin: 0 auto;
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--rooche-dark);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--rooche-border-gray);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--rooche-dark);
    background-color: var(--rooche-white);
    transition: all 0.2s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: var(--rooche-red);
    box-shadow: 0 0 0 3px rgba(229, 35, 52, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

/* Button Styles */
.btn-primary {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--rooche-red);
    color: var(--rooche-white);
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background-color: rgba(229, 35, 52, 0.9);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(229, 35, 52, 0.2);
}

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

/* Google Sign In Button */
.btn-google {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--rooche-white);
    color: #374151;
    border: 1px solid var(--rooche-border-gray);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-google:hover {
    background-color: #f9fafb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
    border-color: #d1d5db;
}

.btn-google:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
    border-color: #4285f4;
}

.btn-google:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-google svg {
    flex-shrink: 0;
}

/* Enhanced Google Sign In Button */
.btn-google-enhanced {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #1f2937;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.btn-google-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.btn-google-enhanced:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
    border-color: #d1d5db;
}

.btn-google-enhanced:hover::before {
    left: 100%;
}

.btn-google-enhanced:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #4285f4;
}

.btn-google-enhanced:active {
    transform: translateY(0);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-google-enhanced:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-google-enhanced svg {
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Error Message */
.error-message {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    border-left: 4px solid var(--rooche-red);
    color: var(--rooche-red);
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px -1px rgba(239, 68, 68, 0.1);
    line-height: 1.6;
}

.error-message strong {
    font-weight: 600;
    color: #dc2626;
}

/* Success Message */
.success-message {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0;
    border-left: 4px solid #22c55e;
    color: #15803d;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px -1px rgba(34, 197, 94, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.success-message::before {
    content: '✓';
    background-color: #22c55e;
    color: white;
    border-radius: 50%;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
}

/* Loading Spinner */
.spinner {
    animation: spin 1s linear infinite;
    width: 1.25rem;
    height: 1.25rem;
}

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

/* Brand Footer */
.brand-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rooche-border-gray);
    margin-top: 1.5rem;
}

.brand-tagline {
    font-size: 0.75rem;
    color: #6b7280;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

/* Page Title */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--rooche-dark);
    margin: 1rem 0 0.5rem 0;
}

.page-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

/* Responsive Design */
@media (max-width: 640px) {
    .login-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .logo-container {
        margin-bottom: 1.5rem;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .logo-image {
        width: 40px;
        height: 40px;
    }
}

/* Animation for form focus */
.form-input:focus {
    transform: translateY(-1px);
}

/* Hover effects for interactive elements */
.form-input:hover:not(:focus) {
    border-color: #d1d5db;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .form-input,
    .btn-primary,
    .spinner {
        transition: none;
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 2px;
    }
    
    .btn-primary {
        border: 2px solid var(--rooche-dark);
    }
}

/* Sidebar Branding */
#sidebar {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    border-right: 1px solid rgba(75, 85, 99, 0.3);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.sidebar-link {
    position: relative;
    overflow: hidden;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.sidebar-link:hover::before {
    left: 100%;
}

.sidebar-link.active {
    background: linear-gradient(135deg, var(--rooche-red) 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(229, 35, 52, 0.3);
}

.sidebar-link.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--rooche-white);
    border-radius: 2px 0 0 2px;
}

/* Sidebar Logo Animation */
#sidebar .group:hover .w-10 {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(229, 35, 52, 0.4);
}

/* Sidebar Text Animation */
.sidebar-text {
    transition: all 0.3s ease;
}

.sidebar-link:hover .sidebar-text {
    transform: translateX(2px);
}

/* Mobile Sidebar Styles */
@media (max-width: 768px) {
    .mobile-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        z-index: 50;
        width: 16rem !important;
        transition: left 0.3s ease-in-out;
    }
    
    .mobile-sidebar.open {
        left: 0;
    }
    
    .mobile-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 40;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease-in-out;
    }
    
    .mobile-sidebar-overlay.open {
        opacity: 1;
        visibility: visible;
    }
    
    /* Adjust main content when sidebar is open */
    .main-content-mobile {
        margin-left: 0;
    }
    
    /* Mobile sidebar logo adjustments */
    .mobile-sidebar .h-16 {
        height: 4rem;
        padding: 0 1rem;
    }
    
    .mobile-sidebar .w-10 {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .mobile-sidebar .w-6 {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    /* Mobile sidebar navigation */
    .mobile-sidebar nav {
        padding: 1rem 0.5rem;
    }
    
    .mobile-sidebar .sidebar-link {
        padding: 0.75rem 1rem;
        margin-bottom: 0.25rem;
    }
    
    .mobile-sidebar .sidebar-text {
        font-size: 0.875rem;
    }
    
    /* Mobile sidebar logout section */
    .mobile-sidebar .px-4 {
        padding: 0 1rem;
    }
}

@media (max-width: 640px) {
    .mobile-sidebar {
        width: 14rem !important;
    }
    
    .mobile-sidebar .sidebar-text {
        font-size: 0.8rem;
    }
    
    .mobile-sidebar .sidebar-link {
        padding: 0.625rem 0.875rem;
    }
}

/* Sidebar Collapsed State */
#sidebar.collapsed {
    width: 5rem; /* 80px */
}

#sidebar.collapsed .sidebar-text,
#sidebar.collapsed .sidebar-logo-text {
    display: none;
}

#sidebar.collapsed .sidebar-link {
    justify-content: center;
}
