/**
 * Ekamuthu Organization - Custom Styles
 * Custom CSS to complement TailwindCSS
 */

/* ============================================
   ROOT VARIABLES - Organization Colors
   ============================================ */
:root {
    /* Primary Colors */
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    
    /* Secondary Colors */
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --secondary-light: #34d399;
    
    /* Accent Colors */
    --accent-red: #ef4444;
    --accent-orange: #f97316;
    --accent-yellow: #eab308;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Organization Specific */
    --org-blue: #1e40af;
    --org-heart: #dc2626;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */

/* For Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ============================================
   ORGANIZATION LOGO STYLES
   ============================================ */

.org-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.org-logo svg {
    width: 24px;
    height: 24px;
    color: white;
}

/* ============================================
   CUSTOM ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.slide-in {
    animation: slideIn 0.3s ease-in-out;
}

.pulse-animation {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-100);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   CUSTOM BUTTONS
   ============================================ */

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

/* ============================================
   CUSTOM CARDS
   ============================================ */

.card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.card-body {
    padding: 1.5rem;
}

/* ============================================
   STATUS BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* ============================================
   TABLES
   ============================================ */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background-color: var(--gray-50);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-800);
}

.table td {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--gray-100);
}

.table tr:hover {
    background-color: var(--gray-50);
}

/* ============================================
   MODAL OVERLAY
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

/* ============================================
   FORM CONTROLS
   ============================================ */

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-100);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

/* ============================================
   SIDEBAR CUSTOM STYLES
   ============================================ */

.sidebar {
    background: linear-gradient(180deg, #2563eb 0%, #1e40af 100%);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar-menu a {
    transition: all 0.2s ease;
}

.sidebar-menu a:hover {
    transform: translateX(4px);
}

/* ============================================
   DASHBOARD STATS CARD
   ============================================ */

.stat-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-top: 0.5rem;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    /* Hide non-printable elements */
    .no-print,
    header,
    aside,
    button,
    .sidebar,
    nav {
        display: none !important;
    }
    
    /* Full width for content */
    main {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    /* Page breaks */
    .page-break {
        page-break-after: always;
    }
    
    /* Print-friendly colors */
    body {
        background: white;
        color: black;
    }
    
    /* Tables */
    table {
        border-collapse: collapse;
        width: 100%;
    }
    
    th, td {
        border: 1px solid #000;
        padding: 8px;
    }
    
    /* Headers for each page */
    @page {
        margin: 2cm;
    }
    
    /* Organization header */
    .print-header {
        text-align: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
    }
    
    .print-header h1 {
        font-size: 24px;
        margin-bottom: 5px;
    }
    
    .print-header p {
        font-size: 12px;
        color: #666;
    }
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

/* Mobile First Approach */
@media (max-width: 640px) {
    .stat-value {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
    .stat-value {
        font-size: 1.75rem;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .container-custom {
        max-width: 1280px;
        margin: 0 auto;
    }
}

/* ============================================
   NOTIFICATION TOAST (Future Use)
   ============================================ */

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 9999;
    animation: slideIn 0.3s ease-in-out;
}

.toast-success {
    border-left: 4px solid var(--secondary-color);
}

.toast-error {
    border-left: 4px solid var(--accent-red);
}

.toast-warning {
    border-left: 4px solid var(--accent-yellow);
}

.toast-info {
    border-left: 4px solid var(--primary-color);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.border-gradient {
    border: 2px solid transparent;
    background-clip: padding-box, border-box;
    background-origin: padding-box, border-box;
    background-image: linear-gradient(white, white), 
                      linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

/* Hide scrollbar but keep functionality */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* ============================================
   ORGANIZATION SPECIFIC
   ============================================ */

/* Death Donation Heart Icon */
.heart-icon {
    color: var(--org-heart);
    filter: drop-shadow(0 2px 4px rgba(220, 38, 38, 0.3));
}

/* Organization Branding */
.org-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--org-blue);
    letter-spacing: -0.02em;
}

/* Member Avatar Initials */
.avatar-initials {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

/* Team Color Badges */
.team-badge-1 { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.team-badge-2 { background: linear-gradient(135deg, #10b981, #059669); }
.team-badge-3 { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.team-badge-4 { background: linear-gradient(135deg, #f97316, #ea580c); }
.team-badge-5 { background: linear-gradient(135deg, #ec4899, #db2777); }
.team-badge-6 { background: linear-gradient(135deg, #6366f1, #4f46e5); }

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1em;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

.skip-to-main:focus {
    left: 50%;
    transform: translateX(-50%);
    top: 10px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--gray-800);
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   END OF CUSTOM STYLES
   ============================================ */