/**
 * DigiMitro Business Hub - Main Stylesheet
 * Mobile-First Design with Modern SaaS Aesthetics
 */

/* ==================== CSS VARIABLES ==================== */
:root {
    --primary-blue: #0066FF;
    --deep-purple: #6738FF;
    --turquoise: #00D6C5;
    --success-green: #10B981;
    --warning-orange: #F59E0B;
    --error-red: #EF4444;
    --bg-white: #FFFFFF;
    --bg-light: #F9FAFB;
    --bg-gray: #F3F4F6;
    --text-dark: #111827;
    --text-gray: #6B7280;
    --text-light: #9CA3AF;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-gray);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--deep-purple);
}

/* ==================== CONTAINER & LAYOUT ==================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 2rem 0;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col {
    flex: 1;
    padding: 0 0.5rem;
}

/* ==================== HEADER & NAVIGATION ==================== */
.header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--deep-purple) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav a {
    color: white;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100vh;
        background: linear-gradient(135deg, var(--primary-blue) 0%, var(--deep-purple) 100%);
        flex-direction: column;
        padding: 5rem 2rem;
        transition: var(--transition);
        box-shadow: var(--shadow-xl);
    }
    
    .nav.active {
        left: 0;
    }
    
    .nav a {
        width: 100%;
        text-align: left;
    }
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--deep-purple) 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary-blue);
    color: white;
}

.btn-success {
    background: var(--success-green);
    color: white;
}

.btn-success:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--error-red);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    filter: brightness(1.1);
}

.btn-whatsapp {
    background: #25D366;
    color: white;
}

.btn-whatsapp:hover:not(:disabled) {
    background: #20BA5A;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1.125rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 50%;
}

/* ==================== CARDS ==================== */
.card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-gray);
}

.card-body {
    padding: 0;
}

.card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Glassmorphism card variant */
.card-glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Tool card for dashboard */
.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    cursor: pointer;
    min-height: 140px;
    justify-content: center;
}

.tool-card .icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--deep-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-card .title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
}

.tool-card:hover {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--deep-purple) 100%);
    color: white;
}

.tool-card:hover .icon {
    -webkit-text-fill-color: white;
    transform: scale(1.1);
}

.tool-card:hover .title {
    color: white;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.form-label .required {
    color: var(--error-red);
    margin-left: 0.25rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    background: var(--bg-white);
    color: var(--text-dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.form-control::placeholder {
    color: var(--text-light);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
}

.form-help {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.form-error {
    display: block;
    font-size: 0.75rem;
    color: var(--error-red);
    margin-top: 0.25rem;
}

.checkbox-wrapper,
.radio-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-wrapper input,
.radio-wrapper input {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

/* File upload */
.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-light);
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-label:hover {
    border-color: var(--primary-blue);
    background: rgba(0, 102, 255, 0.05);
}

/* ==================== GRID SYSTEM ==================== */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ==================== ALERTS & NOTIFICATIONS ==================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border-left: 4px solid var(--success-green);
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid var(--error-red);
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border-left: 4px solid var(--warning-orange);
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border-left: 4px solid var(--primary-blue);
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary { background: #DBEAFE; color: #1E40AF; }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-gray { background: #F3F4F6; color: #374151; }

/* ==================== TABLES ==================== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
}

.table th {
    background: var(--bg-light);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-gray);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover {
    background: var(--bg-light);
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-gray);
    transition: var(--transition);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ==================== UTILITIES ==================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-blue); }
.text-success { color: var(--success-green); }
.text-warning { color: var(--warning-orange); }
.text-danger { color: var(--error-red); }
.text-gray { color: var(--text-gray); }
.text-light { color: var(--text-light); }

.bg-primary { background: var(--primary-blue); }
.bg-light { background: var(--bg-light); }
.bg-white { background: var(--bg-white); }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.rounded { border-radius: var(--border-radius); }
.rounded-sm { border-radius: var(--border-radius-sm); }
.rounded-lg { border-radius: var(--border-radius-lg); }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ==================== LOADING SPINNER ==================== */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.375rem; }
    h3 { font-size: 1.125rem; }
    
    .container {
        padding: 0 1rem;
    }
    
    .section {
        padding: 1.5rem 0;
    }
    
    .card {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .header,
    .nav,
    .btn,
    .modal {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
