/**
 * MailPass - Main Application Styles
 * Version: 1.0.0
 *
 * Custom styles that complement Tailwind CSS
 */

/* ===========================================
   CSS Custom Properties (Design Tokens)
   =========================================== */
:root {
    --color-primary-50: #f0f9ff;
    --color-primary-100: #e0f2fe;
    --color-primary-200: #bae6fd;
    --color-primary-300: #7dd3fc;
    --color-primary-400: #38bdf8;
    --color-primary-500: #0ea5e9;
    --color-primary-600: #0284c7;
    --color-primary-700: #0369a1;
    --color-primary-800: #075985;
    --color-primary-900: #0c4a6e;

    --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Fira Code', 'Monaco', 'Consolas', monospace;
}

/* ===========================================
   Base Styles
   =========================================== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Alpine.js cloak */
[x-cloak] {
    display: none !important;
}

/* ===========================================
   Form Enhancements
   =========================================== */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-primary-500);
}

/* Custom checkbox/radio styles */
input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background-color: var(--color-primary-600);
    border-color: var(--color-primary-600);
}

/* ===========================================
   Button Styles
   =========================================== */
.btn-primary {
    background-color: var(--color-primary-600);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

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

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===========================================
   Loading States
   =========================================== */
.spinner {
    animation: spin 1s linear infinite;
}

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

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===========================================
   Table Enhancements
   =========================================== */
.table-striped tbody tr:nth-child(odd) {
    background-color: #f9fafb;
}

.table-hover tbody tr:hover {
    background-color: #f3f4f6;
}

/* ===========================================
   Card Styles
   =========================================== */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ===========================================
   Badge Styles
   =========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.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;
}

/* ===========================================
   Alert Styles
   =========================================== */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-warning {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* ===========================================
   Sidebar Styles
   =========================================== */
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #9ca3af;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.sidebar-link:hover {
    background-color: #1f2937;
    color: white;
}

.sidebar-link.active {
    background-color: #1f2937;
    color: white;
}

/* ===========================================
   Chart Container
   =========================================== */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ===========================================
   Tooltip Styles
   =========================================== */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background-color: #1f2937;
    color: white;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ===========================================
   Scrollbar Styles
   =========================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ===========================================
   Print Styles
   =========================================== */
@media print {
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    body {
        font-size: 12pt;
    }

    a {
        text-decoration: none;
    }
}

/* ===========================================
   Dark Mode Support (Future)
   =========================================== */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles will be added here */
}

/* ===========================================
   Responsive Utilities
   =========================================== */
@media (max-width: 640px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }
}

@media (min-width: 1025px) {
    .hide-desktop {
        display: none !important;
    }
}
