/*-- -------------------------- -->
<---          RESET             -->
<--- -------------------------- -*/

/* Reset and base styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --primary-color-dark: #2980b9;
    --secondary-color: #2ecc71;
    --secondary-color-dark: #27ae60;
    --text-color: #34495e;
    --body-bg: #f8f9fa; /* Lighter background for better contrast */
    --container-bg: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 10px 20px rgba(0, 0, 0, 0.07);
    --font-family: 'Poppins', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --h1: 3.052rem;
    --h2: 2.441rem;
    --h3: 1.953rem;
    --h4: 1.563rem;
    --h5: 1.25rem;
    --text-large: 1.25rem;
    --text-medium: 1rem;
    --text-small: 0.8rem;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--body-bg);
}

/*-- -------------------------- -->
<---          TYPOGRAPHY        -->
<--- -------------------------- -*/

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    line-height: 1.2;
}

h1 {
    font-size: var(--h1);
}

h2 {
    font-size: var(--h2);
}

h3 {
    font-size: var(--h3);
}

h4 {
    font-size: var(--h4);
}

h5 {
    font-size: var(--h5);
}

/*-- -------------------------- -->
<---          Buttons           -->
<--- -------------------------- -*/

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

/*-- -------------------------- -->
<---           Forms            -->
<--- -------------------------- -*/

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/*-- -------------------------- -->
<---           Alerts           -->
<--- -------------------------- -*/

.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    border-left: 5px solid;
}

.alert-error {
    background-color: #fde8e8;
    color: #e53e3e;
    border-color: #e53e3e;
}

/*-- -------------------------- -->
<---       Landing Page         -->
<--- -------------------------- -*/

.landing-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.landing-header {
    padding: 1.5rem 3rem;
    background-color: var(--container-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.landing-main {
    flex: 1;
    padding: 3rem;
}

.hero-section {
    text-align: center;
    padding: 4rem 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.hero-section h2 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.cta-buttons {
    margin-top: 2.5rem;
}

.cta-buttons .btn {
    margin: 0 0.75rem;
}

.features-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 5rem;
}

.feature {
    text-align: center;
    padding: 2rem;
    background: var(--container-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1);
}

.landing-footer {
    padding: 1.5rem 3rem;
    text-align: center;
    background-color: #ecf0f1;
}

/*-- -------------------------- -->
<---        Auth Pages          -->
<--- -------------------------- -*/

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-form {
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
    background: var(--container-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.auth-form h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.auth-link {
    text-align: center;
    margin-top: 2rem;
}

/*-- -------------------------- -->
<---        App Layout          -->
<--- -------------------------- -*/

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0; /* Prevents sidebar from shrinking */
}

.sidebar-header {
    padding: 2rem;
    border-bottom: 1px solid #34495e;
    text-align: center;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
}

.nav-item {
    display: block;
    padding: 1rem 2rem;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    background-color: #34495e;
    color: white;
    border-left-color: var(--primary-color);
}

.sidebar-footer {
    padding: 1.5rem 0;
    border-top: 1px solid #34495e;
}

.main-content {
    flex: 1;
    background-color: var(--body-bg);
    padding: 2rem; /* Consistent padding for desktop view */
}

.content-header {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e1e4e8;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/*-- -------------------------- -->
<---    Dashboard Components    -->
<--- -------------------------- -*/

.dashboard-grid {
    display: grid;
    gap: 2rem;
}

.subscription-status,
.stat-card,
.recent-campaigns {
    background: var(--container-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.stat-card {
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/*-- -------------------------- -->
<---           Tables           -->
<--- -------------------------- -*/

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e1e4e8;
}

.data-table th {
    font-weight: 600;
    background-color: #f8f9fa;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/*-- -------------------------- -->
<---         Empty State        -->
<--- -------------------------- -*/

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    background-color: var(--container-bg);
    border-radius: var(--border-radius);
}

.view-all {
    text-align: center;
    margin-top: 2rem;
}

/*-- -------------------------- -->
<---      Responsive Design     -->
<--- -------------------------- -*/

@media (max-width: 992px) {
    .sidebar {
        width: 240px; /* Slightly smaller sidebar on medium screens */
    }
}


@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 2; /* Sidebar moves to the bottom */
    }
    
    .main-content {
        order: 1; /* Main content on top */
        padding: 1.5rem; /* KEY FIX: Ensures padding on mobile */
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px; /* Slightly smaller base font on small devices */
    }
    
    .main-content {
        padding: 1rem; /* Adjust padding for very small screens */
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-section h2 {
        font-size: 2.5rem;
    }
    
    .features-section,
    .dashboard-grid {
        gap: 1.5rem;
    }

    .subscription-status,
    .stat-card,
    .recent-campaigns,
    .auth-form {
        padding: 1.5rem; /* Reduce padding inside cards */
    }
}
/* =================================
   Hero Section & CTA Buttons
   (Assuming you have some base styles)
   ================================= */

.hero-section {
    text-align: center;
    padding: 60px 20px;
}

.cta-buttons {
    margin-top: 30px;
}

.btn {
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin: 5px;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}


/* =================================
   "Why AdTrackPro?" Section
   ================================= */
.why-section {
    text-align: center;
    padding: 60px 20px;
    background-color: #f8f9fa; /* A light grey background to separate the section */
}

.section-title {
    margin-bottom: 40px;
    font-size: 2.2rem;
    color: #333;
}

.features-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.feature-card {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 30px;
    max-width: 340px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid #007bff; /* Accent color border */
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.feature-card .icon {
    font-size: 2.5rem;
    color: #007bff;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
}

.feature-card p {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
}


/* =================================
   Social Share Section
   ================================= */
.social-share-section {
    padding: 60px 20px;
    text-align: center; /* Ensures the title is centered */
}

.social-icons {
    display: flex; /* Use flexbox for easy centering */
    justify-content: center; /* Center items horizontally */
    flex-wrap: wrap; /* Allow icons to wrap on smaller screens */
    gap: 15px; /* Space between icons */
    margin-top: 20px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.1);
}

/* Individual icon colors */
.social-icon.facebook { background-color: #1877F2; }
.social-icon.twitter { background-color: #1DA1F2; }
.social-icon.linkedin { background-color: #0A66C2; }
.social-icon.email { background-color: #7f7f7f; }
.social-icon.whatsapp { background-color: #25D366; }
.social-icon.telegram { background-color: #2AABEE; }


/* =================================
   Responsive Design (Media Queries)
   ================================= */

/* For tablets and smaller devices */
@media (max-width: 768px) {
    .section-title, .hero-section h2 {
        font-size: 1.8rem;
    }

    .features-grid {
        flex-direction: column; /* Stack feature cards vertically */
        align-items: center; /* Center the stacked cards */
    }

    .feature-card {
        max-width: 90%;
    }
}

/* For mobile phones */
@media (max-width: 480px) {
    .cta-buttons {
        display: flex;
        flex-direction: column; /* Stack CTA buttons vertically */
        align-items: center;
    }

    .btn {
        width: 80%;
        text-align: center;
        margin-bottom: 10px;
    }

    .why-section, .social-share-section, .hero-section {
        padding: 40px 15px;
    }
}