/* ========== RESPONSIVE STYLES - STICKERLINK ========== */
/* Mobile First - Sudah diatur di style.css */

/* ========== EXTRA SMALL DEVICES (Phone, 0 - 480px) ========== */
@media (max-width: 480px) {
    /* Container */
    .container {
        padding: 12px;
    }
    
    /* Header */
    .header {
        padding: 0 12px;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .header-icon, .menu-toggle {
        width: 34px;
        height: 34px;
    }
    
    /* Hero */
    .hero {
        padding: 20px 0;
    }
    
    .hero-icon {
        font-size: 40px;
    }
    
    .hero-title {
        font-size: 22px;
    }
    
    .hero-subtitle {
        font-size: 13px;
        padding: 0 10px;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 18px;
        font-size: 13px;
        min-width: auto;
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    /* Cards */
    .features-grid, .products-grid, .dashboard-grid {
        gap: 12px;
    }
    
    .feature-card, .product-card, .dashboard-card {
        padding: 16px;
    }
    
    .feature-icon, .card-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .feature-card h3, .card-title {
        font-size: 16px;
    }
    
    /* Pricing */
    .pricing-price {
        font-size: 24px;
    }
    
    .pricing-card li {
        font-size: 13px;
    }
    
    /* Forms */
    .form-container {
        padding: 16px;
    }
    
    .form-control {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .tabs {
        gap: 8px;
    }
    
    .tab-btn {
        padding: 8px;
        font-size: 13px;
    }
    
    /* OTP */
    .otp-input {
        width: 40px;
        height: 45px;
        font-size: 1rem;
    }
    
    /* Modal */
    .modal-content {
        max-width: 95%;
        margin: 0 auto;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    /* Table */
    .table-container {
        padding: 12px;
    }
    
    th, td {
        padding: 10px;
        font-size: 12px;
    }
    
    /* Footer */
    .footer {
        padding: 32px 0 20px;
    }
    
    .footer-grid {
        gap: 24px;
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .footer-links ul li a {
        justify-content: center;
    }
    
    /* Back to Top */
    .back-to-top {
        bottom: 85px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    /* Notification */
    .notification {
        bottom: 85px;
        right: 12px;
        left: 12px;
        max-width: calc(100% - 24px);
        font-size: 13px;
    }
    
    /* Store Preview */
    .store-preview-container {
        padding: 16px;
    }
    
    .store-banner {
        height: 100px;
    }
    
    .store-avatar {
        width: 70px;
        height: 70px;
        font-size: 1.5rem;
    }
    
    .store-name-display {
        font-size: 1.2rem;
    }
    
    .store-category-badge {
        font-size: 11px;
        padding: 4px 12px;
    }
    
    .store-description-display {
        font-size: 13px;
    }
    
    .store-visits-count {
        font-size: 1.3rem;
    }
    
    /* Steps */
    .steps {
        flex-direction: column;
        gap: 10px;
    }
    
    .step {
        min-width: auto;
        padding: 12px;
    }
    
    /* TikTok Grid */
    .tiktok-grid {
        grid-template-columns: 1fr;
    }
    
    /* Settings */
    .settings-item {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .settings-title {
        font-size: 14px;
    }
    
    /* Verification */
    .verification-section {
        flex-direction: column;
        text-align: center;
    }
    
    .camera-preview {
        height: 200px;
    }
    
    .ktp-guide {
        width: 180px;
        height: 120px;
    }
    
    .ktp-guide::before {
        font-size: 9px;
        white-space: normal;
        width: 160px;
        text-align: center;
        top: -28px;
    }
    
    .camera-controls {
        gap: 8px;
        padding: 12px;
    }
    
    .camera-btn {
        padding: 8px;
        font-size: 12px;
    }
}

/* ========== SMALL DEVICES (Phone Landscape, 481px - 768px) ========== */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .features-grid, .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .pricing-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tiktok-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        text-align: left;
    }
    
    .footer-logo {
        justify-content: flex-start;
    }
    
    .footer-links ul li a {
        justify-content: flex-start;
    }
    
    .steps {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .store-search-input-group {
        flex-direction: row;
    }
}

/* ========== TABLET DEVICES (769px - 1024px) ========== */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 900px;
        margin: 0 auto;
        padding: 20px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .features-grid, .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .pricing-cards {
        grid-template-columns: repeat(2, 1fr);
        max-width: 700px;
        margin: 30px auto;
    }
    
    .tiktok-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 600px;
        margin: 20px auto;
    }
    
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .store-search-input-group {
        max-width: 500px;
        margin: 20px auto;
    }
}

/* ========== DESKTOP DEVICES (1025px - 1440px) ========== */
@media (min-width: 1025px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 24px;
    }
    
    .hero-title {
        font-size: 38px;
    }
    
    .hero-subtitle {
        font-size: 18px;
        max-width: 700px;
    }
    
    .features-grid, .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
    
    .pricing-cards {
        grid-template-columns: repeat(2, 1fr);
        max-width: 900px;
        margin: 40px auto;
    }
    
    .tiktok-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 700px;
        margin: 30px auto;
    }
    
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 50px;
    }
    
    .store-search-input-group {
        max-width: 600px;
        margin: 30px auto;
    }
    
    .steps {
        gap: 30px;
    }
    
    .step {
        min-width: 150px;
        padding: 20px;
    }
}

/* ========== LARGE DESKTOP (1441px+) ========== */
@media (min-width: 1441px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 44px;
    }
    
    .hero-subtitle {
        font-size: 20px;
    }
    
    .features-grid, .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .btn-lg {
        padding: 16px 36px;
        font-size: 18px;
    }
}

/* ========== MOBILE LANDSCAPE ORIENTATION ========== */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        height: 50px;
    }
    
    .main-content {
        padding-top: 50px;
    }
    
    .hero {
        padding: 15px 0;
    }
    
    .hero-icon {
        font-size: 32px;
    }
    
    .hero-title {
        font-size: 20px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        max-height: 90vh;
    }
    
    .camera-preview {
        height: 150px;
    }
    
    .chat-messages {
        max-height: 200px;
    }
}

/* ========== NAVBAR BAWAH RESPONSIVE (KHUSUS) ========== */
/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .bottom-nav {
        max-width: 450px;
        height: 60px;
    }
    
    .nav-item i {
        font-size: 20px;
    }
    
    .nav-item span {
        font-size: 10px;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .bottom-nav {
        max-width: 500px;
        height: 65px;
    }
    
    .nav-item i {
        font-size: 22px;
    }
    
    .nav-item span {
        font-size: 11px;
    }
    
    .nav-item:hover {
        transform: translateY(-2px);
    }
}

/* Mobile Landscape */
@media (max-width: 768px) and (orientation: landscape) {
    .bottom-nav {
        height: 50px;
        bottom: 8px;
    }
    
    .nav-item i {
        font-size: 18px;
    }
    
    .nav-item span {
        font-size: 9px;
    }
}

/* Small Mobile */
@media (max-width: 380px) {
    .bottom-nav {
        height: 55px;
        padding: 0 4px;
    }
    
    .nav-item i {
        font-size: 18px;
    }
    
    .nav-item span {
        font-size: 9px;
    }
}

/* Safe Area untuk iPhone dengan notch */
@supports (padding: max(0px)) {
    .bottom-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        margin-bottom: env(safe-area-inset-bottom);
    }
    
    body {
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 16px);
    }
}

/* ========== SIDEBAR RESPONSIVE ========== */
@media (max-width: 480px) {
    .sidebar {
        width: 85%;
        max-width: 280px;
    }
    
    .sidebar-header {
        padding: 16px;
    }
    
    .sidebar-content {
        padding: 16px;
    }
    
    .user-info-sidebar {
        padding: 12px;
    }
    
    .user-avatar-sidebar {
        width: 48px;
        height: 48px;
    }
}

/* ========== CHAT RESPONSIVE ========== */
@media (max-width: 480px) {
    .chat-messages {
        max-height: 300px;
        padding: 12px;
    }
    
    .chat-bubble {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .chat-input {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .chat-send {
        width: 42px;
        height: 42px;
    }
    
    .chat-chips {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chat-chip {
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* ========== GARZ AI RESPONSIVE ========== */
@media (max-width: 480px) {
    .garz-ai-window {
        width: calc(100% - 32px);
        right: 16px;
        left: 16px;
        height: 60vh;
        bottom: 100px;
    }
    
    .garz-ai-button {
        bottom: 85px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
    
    .garz-ai-chips {
        grid-template-columns: 1fr;
    }
}

/* ========== ANALYTICS RESPONSIVE ========== */
@media (max-width: 480px) {
    .analytics-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .analytics-title {
        font-size: 1.3rem;
    }
    
    .analytics-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .time-filter {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .export-btn {
        padding: 6px 14px;
        font-size: 11px;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .charts-container {
        gap: 16px;
    }
    
    .chart-card {
        padding: 12px;
    }
    
    .chart-wrapper {
        height: 180px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
}

/* ========== MOBILE PREVIEW RESPONSIVE ========== */
@media (max-width: 480px) {
    .mobile-preview-container {
        padding: 12px;
    }
    
    .mobile-device {
        border-width: 6px;
    }
    
    .mobile-device::before {
        width: 120px;
        height: 24px;
    }
    
    .mobile-status-bar {
        padding-top: 28px;
        font-size: 10px;
    }
    
    .mobile-content {
        padding: 12px;
        max-height: 350px;
    }
    
    .mobile-product-grid {
        gap: 8px;
    }
    
    .mobile-product-card {
        padding: 8px;
    }
    
    .mobile-product-image {
        height: 55px;
    }
    
    .mobile-nav-item i {
        font-size: 0.9rem;
    }
    
    .mobile-nav-item span {
        font-size: 0.55rem;
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    .header, .bottom-nav, .sidebar-overlay, .sidebar, 
    .garz-ai-button, .back-to-top, .footer {
        display: none;
    }
    
    .main-content {
        padding-top: 0;
    }
    
    .page {
        display: block !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .container {
        padding: 0;
        margin: 0;
    }
    
    .btn, .menu-toggle, .header-icon {
        display: none;
    }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero-icon, .garz-ai-button {
        animation: none;
    }
}

/* ========== HIGH CONTRAST MODE ========== */
@media (prefers-contrast: high) {
    .btn-primary {
        background: var(--primary);
    }
    
    .border-light, .border-medium {
        border-width: 2px;
    }
    
    .shadow, .shadow-md, .shadow-lg {
        box-shadow: none;
        border: 1px solid currentColor;
    }
}

/* ========== DARK MODE RESPONSIVE ADAPTATION ========== */
@media (prefers-color-scheme: dark) {
    body:not(.dark-mode) {
        --bg-primary: #0F172A;
        --bg-secondary: #1E293B;
        --card-bg: #1E293B;
        --text-color: #F1F5F9;
        --text-secondary: #CBD5E1;
        --border-color: #334155;
    }
}

/* ========== TOUCH DEVICE OPTIMIZATION ========== */
@media (hover: none) and (pointer: coarse) {
    .btn:hover, .feature-card:hover, .product-card:hover {
        transform: none;
    }
    
    .btn:active, .feature-card:active, .product-card:active {
        transform: scale(0.98);
    }
    
    .sidebar-menu a:hover {
        transform: none;
    }
    
    .sidebar-menu a:active {
        background: var(--primary-soft);
        transform: scale(0.98);
    }
}

/* ========== SAFE AREA (Notch & Dynamic Island) ========== */
@supports (padding: max(0px)) {
    .header {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-top: env(safe-area-inset-top);
    }
    
    .sidebar {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ========== LOADING STATES ========== */
.loading-skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--bg-secondary) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    border-radius: 8px;
}

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

/* ========== FOCUS VISIBLE ========== */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========== SCROLLBAR CUSTOM ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--border-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ========== SELECTION COLOR ========== */
::selection {
    background: var(--primary);
    color: white;
}

/* ========== PLACEHOLDER STYLE ========== */
::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
    font-size: 13px;
}

/* ========== DISABLED STATE ========== */
.btn:disabled, button:disabled, .disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

.slide-down {
    animation: slideDown 0.3s ease;
}
