/* ===================================
   Advertisers Responsive Styles
   MotionSpotter Platform
   =================================== */

/* Base Responsive Utilities */
:root {
    --mobile-padding: 1rem;
    --tablet-padding: 1.5rem;
    --desktop-padding: 2rem;
}

/* Mobile First Approach */
* {
    box-sizing: border-box;
}

/* Responsive Container */
.responsive-container {
    width: 100%;
    padding-left: var(--mobile-padding);
    padding-right: var(--mobile-padding);
}

@media (min-width: 768px) {
    .responsive-container {
        padding-left: var(--tablet-padding);
        padding-right: var(--tablet-padding);
    }
}

@media (min-width: 1024px) {
    .responsive-container {
        padding-left: var(--desktop-padding);
        padding-right: var(--desktop-padding);
    }
}

/* Responsive Grid */
.responsive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .responsive-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

@media (min-width: 1024px) {
    .responsive-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Responsive Tables */
.responsive-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.responsive-table {
    width: 100%;
    min-width: 600px;
}

/* Table to Cards on Mobile */
@media (max-width: 767px) {
    .table-to-cards {
        display: none;
    }
    
    .mobile-cards {
        display: block;
    }
    
    .mobile-card {
        background: white;
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border: 1px solid #e5e7eb;
    }
    
    .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .mobile-card-body {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .mobile-card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
    }
    
    .mobile-card-label {
        font-weight: 600;
        color: #6b7280;
        font-size: 0.875rem;
    }
    
    .mobile-card-value {
        font-weight: 500;
        color: #111827;
        text-align: left;
    }
    
    [dir="rtl"] .mobile-card-value {
        text-align: right;
    }
}

@media (min-width: 768px) {
    .mobile-cards {
        display: none;
    }
    
    .table-to-cards {
        display: table;
    }
}

/* Responsive Stats Cards */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

@media (min-width: 768px) {
    .stat-card {
        padding: 1.5rem;
    }
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .stat-icon {
        width: 56px;
        height: 56px;
    }
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
}

@media (min-width: 768px) {
    .stat-value {
        font-size: 2rem;
    }
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* Responsive Buttons */
.btn-responsive {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .btn-responsive {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
    }
}

.btn-full-mobile {
    width: 100%;
}

@media (min-width: 640px) {
    .btn-full-mobile {
        width: auto;
    }
}

/* Responsive Forms */
.form-responsive {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-responsive {
        gap: 1.5rem;
    }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

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

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-height: 44px;
}

.form-input:focus {
    outline: none;
    border-color: #6100d1;
    box-shadow: 0 0 0 3px rgba(97, 0, 209, 0.1);
}

/* Responsive Typography */
.heading-1 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .heading-1 {
        font-size: 2rem;
    }
}

@media (min-width: 1024px) {
    .heading-1 {
        font-size: 2.5rem;
    }
}

.heading-2 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .heading-2 {
        font-size: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .heading-2 {
        font-size: 1.875rem;
    }
}

.heading-3 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .heading-3 {
        font-size: 1.25rem;
    }
}

/* Responsive Spacing */
.section-padding {
    padding: 1rem;
}

@media (min-width: 768px) {
    .section-padding {
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .section-padding {
        padding: 2rem;
    }
}

/* Hide/Show Elements */
.mobile-only {
    display: block;
}

.tablet-up {
    display: none;
}

.desktop-only {
    display: none;
}

@media (min-width: 768px) {
    .mobile-only {
        display: none;
    }
    
    .tablet-up {
        display: block;
    }
}

@media (min-width: 1024px) {
    .desktop-only {
        display: block;
    }
}

/* Responsive Images */
.responsive-img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive Charts */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

@media (min-width: 768px) {
    .chart-container {
        height: 300px;
    }
}

@media (min-width: 1024px) {
    .chart-container {
        height: 350px;
    }
}

/* Responsive Modal */
.modal-responsive {
    width: 95%;
    max-width: 500px;
    margin: 1rem auto;
}

@media (min-width: 768px) {
    .modal-responsive {
        width: 90%;
        max-width: 600px;
    }
}

@media (min-width: 1024px) {
    .modal-responsive {
        max-width: 800px;
    }
}

/* Touch-friendly Elements */
@media (hover: none) and (pointer: coarse) {
    .btn-responsive,
    .form-input,
    .sidebar-item {
        min-height: 48px;
    }
}

/* Prevent Horizontal Scroll */
body {
    overflow-x: hidden;
}

/* Smooth Transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-duration: 200ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

