/**
 * Invoicely - Free Billing Software
 * Custom Styles
 * by Timeline Digital Solutions
 */

/* ==================== BASE STYLES ==================== */
[x-cloak] { 
    display: none !important; 
}

/* ==================== GLASS MORPHISM ==================== */
.glass { 
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);
}

/* ==================== LOADER ANIMATION ==================== */
.loader {
    border: 3px solid #f3f3f3; 
    border-top: 3px solid #2563EB; 
    border-radius: 50%;
    width: 20px; 
    height: 20px; 
    animation: spin 1s linear infinite;
}

@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

/* ==================== SEO TAGS CLOUD ==================== */
.seo-tag { 
    display: inline-block; 
    background: #eef2ff; 
    color: #4338ca; 
    padding: 4px 10px; 
    border-radius: 999px; 
    font-size: 0.75rem; 
    font-weight: 600; 
    margin: 0 4px 4px 0; 
    transition: all 0.2s; 
}

.seo-tag:hover { 
    background: #4338ca; 
    color: white; 
}

/* ==================== CUSTOM SCROLLBAR ==================== */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==================== FORM ELEMENTS ==================== */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* ==================== BUTTON EFFECTS ==================== */
button {
    cursor: pointer;
    transition: all 0.2s ease;
}

button:active {
    transform: scale(0.98);
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.notification-enter {
    animation: slideIn 0.3s ease-out;
}

.notification-exit {
    animation: slideOut 0.3s ease-in;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ==================== TABLE STYLES ==================== */
table {
    border-collapse: collapse;
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
}

/* ==================== RESPONSIVE ADJUSTMENTS ==================== */
@media (max-width: 768px) {
    .mobile-full {
        width: 100% !important;
    }
}

@media (max-width: 640px) {
    /* Ensure proper mobile display */
    html {
        -webkit-text-size-adjust: 100%;
    }
    
    body {
        overflow-x: hidden;
    }
    
    /* Touch-friendly button sizes */
    button, 
    a.btn,
    input[type="button"],
    input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better tap targets for links */
    a {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Prevent horizontal scroll */
    .max-w-7xl {
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* Mobile-first table handling */
@media (max-width: 640px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ==================== TRANSITIONS ==================== */
.fade-enter {
    opacity: 0;
}

.fade-enter-active {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.fade-exit {
    opacity: 1;
}

.fade-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ==================== SIDEBAR STYLES ==================== */
.sidebar-item {
    transition: all 0.2s ease;
}

.sidebar-item:hover {
    transform: translateX(4px);
}

.sidebar-item.active {
    position: relative;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #2563EB;
    border-radius: 0 2px 2px 0;
}

/* ==================== CARD HOVER EFFECTS ==================== */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* ==================== STATUS BADGE STYLES ==================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-paid {
    background-color: #dcfce7;
    color: #166534;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-sent {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-overdue {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-draft {
    background-color: #f1f5f9;
    color: #475569;
}

/* ==================== CHART CONTAINER ==================== */
.chart-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ==================== INPUT FOCUS STYLES ==================== */
.input-focus-ring:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    border-color: #2563EB;
}

/* ==================== LINK STYLES ==================== */
a {
    text-decoration: none;
    transition: color 0.2s ease;
}

/* ==================== LOADING OVERLAY ==================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== MODAL BACKDROP ==================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

/* ==================== PDF TEMPLATE STYLES ==================== */
#pdf-container {
    font-family: 'Inter', sans-serif;
}

#pdf-container table {
    width: 100%;
    border-collapse: collapse;
}

#pdf-container th,
#pdf-container td {
    padding: 12px;
    text-align: left;
}
