/**
 * Custom Colors for Quran Academy
 * Primary: #38785e (Green)
 * Secondary: #feecda (Beige)
 * Accent: #c4a15d (Gold)
 */

:root {
    --primary-color: #38785e;
    --primary-hover: #2d6149;
    --primary-light: #4a9274;
    --secondary-color: #feecda;
    --secondary-dark: #f5dcc4;
    --accent-color: #c4a15d;
    --accent-hover: #a88a4d;
}

/* Primary Button Styles */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

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

/* Secondary Background */
.bg-secondary {
    background-color: var(--secondary-color);
}

/* Accent Color */
.text-accent {
    color: var(--accent-color);
}

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

.bg-accent:hover {
    background-color: var(--accent-hover);
}

/* Navigation Bar */
.navbar-primary {
    background-color: var(--primary-color);
}

/* Card Hover Effects */
.card-hover:hover {
    box-shadow: 0 10px 25px rgba(56, 120, 94, 0.15);
}

/* Link Colors */
.link-primary {
    color: var(--primary-color);
}

.link-primary:hover {
    color: var(--primary-hover);
}

/* Badge Primary */
.badge-primary {
    background-color: rgba(56, 120, 94, 0.1);
    color: var(--primary-color);
}

/* Success/Positive Metrics - Using Primary Green */
.metric-positive {
    color: var(--primary-color);
}

/* Revenue/Income - Using Accent Gold */
.metric-revenue {
    color: var(--accent-color);
}

/* Footer */
.footer-primary {
    background-color: var(--primary-color);
}

/* ========================================
   Mobile Responsive Enhancements
   ======================================== */

/* Base Mobile Styles */
@media (max-width: 768px) {
    /* Reduce padding on mobile */
    .max-w-7xl {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Make tables horizontally scrollable */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }

    /* Headers are handled by Tailwind responsive classes now */

    /* Make buttons full width on mobile */
    .mobile-full-width {
        width: 100%;
    }

    /* Stack cards vertically - but gaps handled by Tailwind */

    /* Padding in cards handled by Tailwind responsive classes */

    /* Make modals fill screen better on mobile */
    .fixed.inset-0 > div {
        margin: 0.5rem !important;
        width: calc(100% - 1rem) !important;
        max-width: none !important;
    }

    /* Better spacing for form inputs */
    input[type="text"],
    input[type="number"],
    input[type="date"],
    input[type="datetime-local"],
    select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }

    /* Touch-friendly button sizes - don't override specific sizes */
    button:not([class*="text-"]),
    .btn:not([class*="text-"]) {
        min-height: 44px; /* Apple's recommended touch target */
    }

    /* Improve table readability on mobile */
    table {
        font-size: 0.875rem;
    }

    table th,
    table td {
        padding: 0.5rem !important;
        white-space: nowrap;
    }

    /* Keep navbar horizontal on mobile */
    nav .flex.items-center.justify-between {
        flex-direction: row !important;
        align-items: center !important;
    }

    .flex.gap-3 {
        flex-direction: column;
        width: 100%;
    }

    .flex.gap-3 > * {
        width: 100%;
    }

    /* Navigation improvements */
    nav a {
        padding: 0.75rem 1rem !important;
    }

    /* Statistics cards - better mobile layout */
    .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Hide less important columns on very small screens */
    @media (max-width: 480px) {
        .hide-on-small {
            display: none;
        }

        /* Single column for very small screens */
        .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-4 {
            grid-template-columns: 1fr !important;
        }
    }

    /* Better whitespace on mobile */
    .space-y-3 > * {
        margin-top: 0.75rem !important;
    }

    /* Modal improvements for mobile */
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Tablet Specific Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .max-w-7xl {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    /* 2 columns for tablets */
    .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Touch improvements for all devices */
@media (hover: none) {
    /* Remove hover effects on touch devices */
    .hover\\:bg-gray-50:hover {
        background-color: transparent;
    }

    /* Add active states instead */
    .hover\\:bg-gray-50:active {
        background-color: rgb(249 250 251);
    }

    button:active,
    a:active {
        opacity: 0.7;
    }
}
