/**
 * Ring DAS SDK Demo - Styles
 * Responsive layout with ad slot containers
 */

/* ========== Reset & Base Styles ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Figtree, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #000000;
    background: #f5f7fa;
}

/* ========== Container ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
}

/* ========== Header ========== */
header {
    background: #000000;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid #25B2E8;
}

.header-logo {
    max-width: 120px;
    height: auto;
    flex-shrink: 0;
}

.header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 500;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
}

/* ========== Ad Sections ========== */
.ad-section {
    margin: 1.5rem 0;
}

.ad-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========== Ad Containers ========== */
.ad-container {
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ad-container:hover {
    border-color: #9ca3af;
}

/* Top banner - Leaderboard */
.ad-top {
    min-height: 90px;
    max-width: 970px;
    margin: 1.5rem auto;
}

/* Sidebar ads - Medium Rectangle */
.ad-sidebar {
    min-height: 250px;
    width: 100%;
    max-width: 300px;
}

/* Sidebar tall - Skyscraper */
.ad-sidebar-tall {
    min-height: 600px;
    width: 100%;
    max-width: 300px;
}

/* Ad placeholder */
.ad-placeholder {
    padding: 2rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
    font-style: italic;
}

.ad-placeholder-empty {
    color: #ef4444;
    font-weight: 600;
}

/* ========== Content Layout ========== */
.content-wrapper {
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    gap: 2rem;
    padding: 2rem;
    min-height: 800px;
}

/* Sidebars */
.sidebar {
    background: #fafbfc;
    padding: 1.5rem;
    border-radius: 8px;
}

.sidebar-left {
    border-right: 1px solid #e5e7eb;
}

.sidebar-right {
    border-left: 1px solid #e5e7eb;
}

/* Main content */
.main-content {
    padding: 0 1rem;
}

article h2 {
    color: #1f2937;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

article h3 {
    color: #374151;
    margin: 1.5rem 0 1rem;
    font-size: 1.3rem;
}

article p {
    margin-bottom: 1rem;
    color: #4b5563;
    text-align: justify;
}

article ul {
    margin: 1rem 0 1rem 2rem;
    color: #4b5563;
}

article li {
    margin-bottom: 0.5rem;
}

/* ========== Sidebar Widgets ========== */
.sidebar-widget {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.sidebar-widget h4 {
    color: #1f2937;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 2px solid #25B2E8;
    padding-bottom: 0.5rem;
}

/* Status info */
.status-info {
    font-size: 0.9rem;
}

.status-success {
    color: #059669;
    font-weight: 500;
}

.status-error {
    color: #dc2626;
    font-weight: 500;
}

/* Metrics */
.metrics-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 4px;
}

.metric-label {
    font-size: 0.9rem;
    color: #6b7280;
}

.metric-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #25B2E8;
}

/* ========== Footer ========== */
footer {
    background: #1f2937;
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
}

footer a {
    color: #25B2E8;
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

/* ========== Debug Console ========== */
.debug-console {
    margin-top: 1.5rem;
    background: #111827;
    border-radius: 8px;
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.debug-console h4 {
    color: #25B2E8;
    margin-bottom: 1rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#debug-output {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #d1d5db;
}

.debug-entry {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: #1f2937;
    border-radius: 4px;
    border-left: 3px solid #25B2E8;
}

.debug-time {
    color: #9ca3af;
    margin-right: 0.5rem;
}

.debug-entry pre {
    margin-top: 0.5rem;
    color: #34d399;
    font-size: 0.8rem;
    overflow-x: auto;
}

/* ========== Responsive Design ========== */

/* Tablets and smaller */
@media (max-width: 1200px) {
    .content-wrapper {
        grid-template-columns: 280px 1fr 280px;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    header h1 {
        font-size: 2rem;
    }

    article h2 {
        font-size: 1.5rem;
    }
}

/* Mobile landscape and smaller tablets */
@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .sidebar-left,
    .sidebar-right {
        border: 1px solid #e5e7eb;
    }

    .ad-sidebar,
    .ad-sidebar-tall {
        max-width: 100%;
        margin: 0 auto;
    }

    .sidebar {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* Mobile portrait */
@media (max-width: 640px) {
    header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-logo {
        max-width: 100px;
    }

    header h1 {
        font-size: 1.25rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .content-wrapper {
        padding: 1rem;
        gap: 1.5rem;
    }

    article p {
        text-align: left;
    }

    .ad-top {
        min-height: 60px;
    }

    .sidebar-widget {
        padding: 1rem;
    }

    .debug-console {
        padding: 1rem;
        max-height: 300px;
    }
}

/* ========== Print Styles ========== */
@media print {
    .ad-container,
    .ad-section,
    footer,
    .debug-console {
        display: none;
    }

    body {
        background: white;
    }
}

/* ========== Animations ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ad-container {
    animation: fadeIn 0.3s ease-in-out;
}

/* ========== Accessibility ========== */
a:focus,
button:focus {
    outline: 2px solid #25B2E8;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ad-container {
        border-width: 3px;
        border-style: solid;
    }

    .metric-value {
        font-weight: 900;
    }
}
