/**
 * WhiteWebWorx Company Portal Custom Styles
 * Clean, modern, professional design matching WhiteWebWorx aesthetic
 */

:root {
    --www-primary: #667eea;
    --www-secondary: #764ba2;
    --www-light: #f8f9fa;
    --www-dark: #333;
    --www-gray: #6c757d;
    --www-border: #dee2e6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: var(--www-dark);
}

/* Navbar Styles */
.navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--www-primary);
}

.navbar-brand img {
    height: 40px;
    margin-right: 10px;
}

/* Hero/Welcome Section */
.hero-section {
    background: linear-gradient(135deg, var(--www-primary) 0%, var(--www-secondary) 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-radius: 0 0 10px 10px;
}

.hero-section h1 {
    font-weight: 300;
    margin-bottom: 0.5rem;
}

.hero-section p {
    opacity: 0.9;
    margin-bottom: 0;
}

/* Card Styles - Matching WhiteWebWorx Design */
.card {
    border: 1px solid var(--www-border);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    margin-bottom: 1.5rem;
    background: white;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.card-header {
    background: var(--www-light);
    border-bottom: 1px solid var(--www-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--www-dark);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: var(--www-light);
    border-top: 1px solid var(--www-border);
    padding: 0.75rem 1.25rem;
}

/* Permission Badges */
.permission-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.badge-admin {
    background-color: #dc3545;
    color: white;
}

.badge-manager {
    background-color: #ffc107;
    color: #333;
}

.badge-user {
    background-color: #6c757d;
    color: white;
}

.badge-finance {
    background-color: #28a745;
    color: white;
}

.badge-hr {
    background-color: #17a2b8;
    color: white;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: var(--www-primary);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Login Section - Always visible when not authenticated */
.login-section {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.login-section.hidden {
    display: none !important;
}

.text-muted {
    color: var(--www-gray) !important;
}

/* Button Styles */
.btn-primary {
    background-color: var(--www-primary);
    border-color: var(--www-primary);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--www-secondary);
    border-color: var(--www-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-outline-primary {
    color: var(--www-primary);
    border-color: var(--www-primary);
}

.btn-outline-primary:hover {
    background-color: var(--www-primary);
    border-color: var(--www-primary);
}

/* Profile Image */
.profile-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--www-border);
}

/* Calendar Event Styles */
.calendar-event {
    border-left: 3px solid var(--www-primary);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--www-light);
    border-radius: 4px;
}

.calendar-event-today {
    border-left-color: #28a745;
    background: #f0fff4;
}

/* Teams Chat Styles */
.teams-chat {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.teams-chat:hover {
    background-color: var(--www-light);
}

.teams-chat-unread {
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Login Section */
.login-section {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    max-width: 400px;
    width: 100%;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--www-gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Developer Resources */
.developer-tool-item {
    transition: all 0.2s ease;
}

.developer-tool-item:hover {
    background-color: var(--www-light) !important;
    transform: translateX(5px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 992px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Smooth Transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Global Loading Overlay */
.global-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: none !important; /* Hidden by default - only shown when authenticated */
    visibility: hidden !important; /* Completely hidden */
    opacity: 0 !important; /* Transparent */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    pointer-events: none !important; /* Don't block clicks when hidden */
}

/* Only show overlay when explicitly enabled via JavaScript AND authenticated */
.global-loading-overlay.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.global-loading-content {
    text-align: center;
    color: white;
}

.global-loading-content .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

