/* AutoCode generated style.css for Marketing Automation Website - Iteration 3 */

/* --- CSS Variables --- */
:root {
    --primary-color: #2980b9; /* A professional blue for accents */
    --secondary-color: #34495e; /* Darker blue/gray for main text/headings */
    --text-color: #333;
    --background-color: #f4f7f6;
    --light-gray: #ecf0f1;
    --border-color: #ddd;
    --spacing-unit: 16px; /* Base spacing unit */
    --font-family-base: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 16px;

    /* Card-like block specific variables */
    --card-bg: #ffffff;
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --card-border-radius: 8px;
    --max-content-width: 900px;
}

/* --- Global Reset & Base Styles --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: var(--spacing-unit);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Common styling for main content blocks (header, footer, dynamic app container) */
header,
footer,
#app { /* #app is the main container for the dynamic SPA content */
    background-color: var(--card-bg);
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 1.5);
    margin-bottom: var(--spacing-unit);
    max-width: var(--max-content-width);
    width: 100%;
    text-align: left; /* Default for content within these blocks */
}

/* Header specific adjustments */
header {
    text-align: center;
    padding-top: calc(var(--spacing-unit) * 1.5);
    padding-bottom: calc(var(--spacing-unit) * 1.5);
}

header h1 {
    font-size: 2.5em;
    line-height: 1.2;
    color: var(--secondary-color);
    margin-top: 0;
    margin-bottom: 0;
}

/* General paragraph styling */
p {
    margin-top: 0;
    margin-bottom: var(--spacing-unit);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: #216fa3; /* A darker shade of primary-color */
}

/* Focus styles for interactive elements for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.2); /* Light primary color shadow */
}

h2 {
    font-size: 2em;
    color: var(--secondary-color);
    margin-top: calc(var(--spacing-unit) * 1.5);
    margin-bottom: var(--spacing-unit);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

h3 {
    font-size: 1.5em;
    color: var(--primary-color);
    margin-top: var(--spacing-unit);
    margin-bottom: calc(var(--spacing-unit) / 2);
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

li {
    margin-bottom: calc(var(--spacing-unit) / 2);
}

strong {
    color: var(--secondary-color);
}

/* Footer specific styles */
footer p {
    text-align: center;
    margin: 0;
}

/* --- Application Specific Styles (#app) --- */
#app {
    display: flex;
    flex-direction: column;
    padding: 0; /* App will manage its own internal padding */
    margin-top: var(--spacing-unit);
    /* #app already has card styling from the general rule,
       but padding is overridden to 0 here to allow internal elements to define it. */
}

/* Navigation Bar */
#main-nav {
    background-color: var(--secondary-color);
    border-top-left-radius: var(--card-border-radius);
    border-top-right-radius: var(--card-border-radius);
    padding: calc(var(--spacing-unit) / 2) var(--spacing-unit);
}

#main-nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

#main-nav li a {
    display: block;
    padding: 10px 20px;
    color: var(--light-gray);
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    border-radius: 4px;
    font-weight: bold;
}

#main-nav li a:hover,
#main-nav li a.active { /* Use 'active' class as per script.js */
    background-color: var(--primary-color);
    color: white;
}

/* Main App Content Area */
#app-content {
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 1.5); /* Padding for the content inside app */
    border-bottom-left-radius: var(--card-border-radius);
    border-bottom-right-radius: var(--card-border-radius);
    flex-grow: 1; /* Allow content to grow */
}

/* Individual App Sections */
.app-section {
    padding: var(--spacing-unit) 0;
    margin-bottom: var(--spacing-unit);
    border-top: 1px solid var(--light-gray);
}

.app-section:first-child {
    border-top: none;
}

.app-section.hidden {
    display: none;
}

/* Dashboard Section */
.metrics {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-unit);
    justify-content: center;
    margin-top: var(--spacing-unit);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.metric-card {
    flex: 1 1 calc(33% - var(--spacing-unit)); /* 3 cards per row, adjusted for gap */
    min-width: 200px;
    background-color: var(--light-gray);
    padding: var(--spacing-unit);
    border-radius: 6px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-card span {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: var(--secondary-color);
    font-size: 1.1em;
}

.metric-card:last-child {
    margin-bottom: 0;
}

.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    color: white; /* Default text color for statuses */
}

.status.active {
    background-color: #27ae60; /* Green */
}

.status.scheduled {
    background-color: #f39c12; /* Orange */
}

.status.draft {
    background-color: #7f8c8d; /* Gray */
}

/* General Form Element Styling for AI Content Generator & Campaign Creator */
.form-group {
    margin-bottom: var(--spacing-unit);
}

.form-group label {
    display: block; /* Make labels block-level for better spacing */
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: calc(var(--spacing-unit) / 4); /* Small gap between label and input */
}

.required-asterisk {
    color: #e74c3c; /* Red color for required fields */
    font-weight: normal; /* Asterisk itself shouldn't be bold */
    margin-left: 3px;
}

input[type="text"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    color: var(--text-color);
    background-color: var(--card-bg); /* Ensure background is white */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* General button styling */
button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
    padding: 10px 20px; /* Consistent padding for all buttons */
    border-radius: 4px;
    width: 100%; /* Default to full width for consistency, can be overridden */
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
}

button:hover {
    background-color: #216fa3; /* Darker shade */
}

/* AI Content Generator Section */
.content-generator {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
    margin-top: var(--spacing-unit);
}

.content-generator label {
    margin-bottom: calc(var(--spacing-unit) / 4); /* Override the negative margin previously set */
}

.output-area {
    background-color: var(--light-gray);
    border: 1px dashed var(--border-color);
    padding: var(--spacing-unit);
    border-radius: 4px;
    min-height: 150px;
    overflow-y: auto;
    font-size: 0.95em;
    color: var(--text-color);
}

.output-area p {
    margin: 0; /* Reset margin for paragraphs inside output */
}

#generate-content-btn,
#add-campaign-btn { /* Renamed to match script.js for consistency */
    margin-top: calc(var(--spacing-unit) / 2); /* Space above button */
}

#copy-content-btn {
    width: auto; /* Override default 100% width for this button */
    align-self: flex-start; /* Align to start in flex column layout */
    margin-top: calc(var(--spacing-unit) / 2);
}

#copy-content-btn.hidden {
    display: none;
}

/* Campaigns Section */
#campaigns ul {
    list-style: disc;
    margin-left: var(--spacing-unit);
    padding-left: 0;
}

#campaigns li {
    margin-bottom: 5px;
}

.campaign-creator {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
    margin-top: var(--spacing-unit);
}


/* --- Responsive Design --- */
@media (max-width: 960px) {
    :root {
        --max-content-width: 760px;
    }
}

@media (max-width: 768px) {
    :root {
        --font-size-base: 15px;
        --spacing-unit: 12px;
    }

    body {
        padding: var(--spacing-unit);
    }

    header h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.8em;
    }

    h3 {
        font-size: 1.3em;
    }

    #main-nav li a {
        padding: 8px 15px;
    }

    .metric-card {
        flex: 1 1 calc(50% - var(--spacing-unit)); /* 2 cards per row */
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-base: 14px;
        --spacing-unit: 8px;
        --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* Lighter shadow on small screens */
    }

    header h1 {
        font-size: 1.8em;
        margin-bottom: 0;
    }

    h2 {
        font-size: 1.5em;
    }

    h3 {
        font-size: 1.2em;
    }

    header, footer, #app { /* Updated selector */
        padding: var(--spacing-unit);
        margin-bottom: var(--spacing-unit);
        border-radius: 6px;
    }

    #main-nav {
        padding: calc(var(--spacing-unit) / 2);
    }

    #main-nav ul {
        flex-wrap: wrap;
        gap: 5px;
    }

    #main-nav li {
        width: 100%; /* Each nav item takes full width */
        text-align: center;
    }

    #main-nav li a {
        padding: 8px 10px;
        font-size: 0.9em;
    }

    #app-content {
        padding: var(--spacing-unit);
    }

    .metric-card {
        flex: 1 1 100%; /* 1 card per row */
    }

    .content-generator label {
        margin-bottom: 0;
    }
}