@import "tailwindcss";

/* Modern Gradient Backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.bg-gradient-dark {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

/* Glass Morphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modern Card Styles */
.card-modern {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.card-modern:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(-4px);
}

.card-gradient {
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    color: white;
    transition: all 0.3s ease;
}

.card-gradient:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
}

/* Animated Background */
.animated-bg {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #4facfe);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Modern Button Styles */
.btn-modern {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    transform: scale(1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-modern:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Glow Effects */
.glow {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.glow-hover:hover {
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.7);
}

/* Modern Input Styles */
.input-modern {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 2px solid rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    background-color: white;
    color: #1f2937;
    font-size: 0.875rem;
    line-height: 1.5;
    display: block;
    min-height: 2.5rem;
}

.input-modern:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    ring: 2px;
    ring-color: #a855f7;
}

.input-modern::placeholder {
    color: #9ca3af;
    opacity: 0.7;
}

/* Icon padding classes */
.input-icon-left {
    padding-left: 3.2rem !important;
}

.input-icon-right {
    padding-right: 3.2rem !important;
}

/* Textarea specific styles */
textarea.input-modern {
    min-height: 6rem;
    resize: vertical;
    font-family: inherit;
}

select.input-modern {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Status Badges */
.badge-modern {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

/* Table Modern */
.table-modern {
    width: 100%;
}

.table-modern thead {
    background: linear-gradient(to right, #9333ea, #6366f1);
    color: white;
}

.table-modern tbody tr {
    transition: background-color 0.2s ease;
}

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

/* Pulse Animation */
.pulse-slow {
    animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Shimmer Effect */
.shimmer {
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.3) 50%, 
        rgba(255,255,255,0) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

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

/* Alignment and Centering Utilities */
.container-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.form-container {
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
}

/* Input Alignment Fixes - Removed duplicate .input-modern definition */

/* Button Alignment */
.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Card Alignment */
.card-modern,
.card-gradient {
    display: flex;
    flex-direction: column;
}

/* Table Cell Alignment */
.table-modern td,
.table-modern th {
    vertical-align: middle;
}

/* Responsive Centering */
@media (max-width: 640px) {
    .form-container {
        padding: 0 1rem;
    }
}

/* Mobile-first responsive table cards */
@media (max-width: 639px) {
    .card-modern:hover {
        transform: none;
    }
    .card-gradient:hover {
        transform: none;
    }
}

/* Responsive nav improvements */
@media (max-width: 639px) {
    nav .shrink-0 span {
        font-size: 1rem;
    }
}

/* Smooth modal backdrop */
.modal-backdrop {
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Info card hover */
.info-card {
    transition: all 0.2s ease;
}
.info-card:hover {
    border-color: #a855f7;
    background-color: #faf5ff;
}

/* Responsive text utilities */
@media (max-width: 480px) {
    .text-responsive-xl {
        font-size: 1rem;
    }
}

/* Overflow guard */
* {
    box-sizing: border-box;
}
body {
    overflow-x: hidden;
}

/* Better focus rings */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* Progress bar animation */
@keyframes progressFill {
    from { width: 0%; }
}
.progress-animated {
    animation: progressFill 0.8s ease-out forwards;
}

/* ================================================================
   SIDEBAR — Scrollbar & Nav Utilities
================================================================ */
.sb-nav-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.sb-nav-scroll::-webkit-scrollbar { width: 4px; }
.sb-nav-scroll::-webkit-scrollbar-track { background: transparent; }
.sb-nav-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

/* Sidebar logo area shrink when collapsed */
.app-sidebar.is-collapsed .sb-logo-area { justify-content: center; padding: 0.875rem 0.5rem; }

/* Top bar heading — strip out any extra padding from header slot content */
.app-topbar .text-slate-700 { line-height: 1.3; }

/* ================================================================
   DASHBOARD — Enterprise CRM Styles
================================================================ */

/* KPI Cards */
.dash-kpi-card {
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.25rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    transition: all 0.25s ease;
}
.dash-kpi-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: #e2e8f0;
}

.kpi-icon-box {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-trend {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
}
.kpi-trend.up   { background: #dcfce7; color: #15803d; }
.kpi-trend.down { background: #fee2e2; color: #b91c1c; }
.kpi-trend.neutral { background: #fef9c3; color: #92400e; }

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-bar {
    height: 4px;
    background: #f1f5f9;
    border-radius: 9999px;
    overflow: hidden;
}
.kpi-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.8s ease;
}

.kpi-link {
    font-size: 0.72rem;
    font-weight: 600;
    transition: all 0.2s ease;
}
.kpi-link:hover { text-decoration: underline; }

/* Dashboard Cards */
.dash-card {
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: box-shadow 0.25s ease;
}
.dash-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
}

.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 1rem 1.25rem;
}

.dash-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
}

.dash-card-subtitle {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 0.15rem;
    font-weight: 500;
}

.dash-view-all {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6366f1;
    transition: color 0.2s;
    white-space: nowrap;
}
.dash-view-all:hover { color: #4338ca; }

/* Table Styles */
.dash-th {
    padding: 0.75rem 1.25rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    background: #f8fafc;
    white-space: nowrap;
}

.dash-tr {
    transition: background-color 0.15s ease;
}
.dash-tr:hover { background-color: #f8fafc; }

.dash-td {
    padding: 0.85rem 1.25rem;
    vertical-align: middle;
}

/* Badges */
.dash-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    white-space: nowrap;
}
.badge-slate   { background: #f1f5f9; color: #475569; }
.badge-blue    { background: #dbeafe; color: #1d4ed8; }
.badge-green   { background: #dcfce7; color: #15803d; }
.badge-purple  { background: #ede9fe; color: #6d28d9; }
.badge-amber   { background: #fef3c7; color: #92400e; }
.badge-teal    { background: #ccfbf1; color: #0f766e; }
.badge-emerald { background: #d1fae5; color: #065f46; }
.badge-red     { background: #fee2e2; color: #b91c1c; }

/* Quick Action Buttons */
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    border-radius: 0.75rem;
    text-align: center;
    transition: all 0.2s ease;
    text-decoration: none;
}
.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Performance bars */
.perf-bar {
    height: 6px;
    background: #f1f5f9;
    border-radius: 9999px;
    overflow: hidden;
}
.perf-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 1s ease;
}

/* Task items */
.task-item {
    padding: 0.625rem 0.75rem;
    border-radius: 0.625rem;
}

/* Responsive overrides */
@media (max-width: 640px) {
    .dash-kpi-card { padding: 1rem; }
    .kpi-value { font-size: 1.6rem; }
    .dash-card-header { padding: 1rem 1rem 0.75rem 1rem; }
    .dash-th, .dash-td { padding-left: 0.875rem; padding-right: 0.875rem; }
}
