/* postp.day - Forest Green Glassmorphism Dashboard */
/* Colors: #0d2b0d, #1a4a1a, #1c2b1c, #2d7a2d, #7a9e7a, #c8e6c8, #f4f9f4 */
/* Fonts: DM Sans (primary), Inter (body), Fira Code (monospace) */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --deep-forest: #0d2b0d;
    --rich-green: #1a4a1a;
    --dark-slate: #1c2b1c;
    --medium-green: #2d7a2d;
    --sage: #7a9e7a;
    --mint-glass: #c8e6c8;
    --near-white: #f4f9f4;
    --transparent-teal: rgba(45, 122, 45, 0.15);
    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-blur: blur(16px);
}

html {
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--deep-forest);
    color: var(--near-white);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

.code-font {
    font-family: 'Fira Code', monospace;
}

/* Circuit SVG Background */
#circuit-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Dashboard Grid */
#dashboard {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-areas:
        "sidebar header"
        "sidebar widgets"
        "sidebar main";
    grid-template-columns: 240px 1fr;
    grid-template-rows: auto auto 1fr;
    min-height: 100vh;
    gap: 0;
}

/* Glass Panel Base */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

/* Sidebar */
#sidebar {
    grid-area: sidebar;
    background: rgba(13, 43, 13, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 24px;
}

.brand-name {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--near-white);
    letter-spacing: -0.02em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--sage);
    text-decoration: none;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(45, 122, 45, 0.15);
    color: var(--mint-glass);
}

.nav-item.active {
    background: rgba(45, 122, 45, 0.25);
    color: var(--near-white);
}

.nav-item svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--medium-green);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(45, 122, 45, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(45, 122, 45, 0); }
}

.status-label {
    font-size: 0.75rem;
    color: var(--sage);
}

/* Header */
#header {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--near-white);
    display: flex;
    align-items: center;
    gap: 2px;
}

.typewriter {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: none;
    width: 0;
    animation: typewriter-reveal 1.5s steps(18) 0.5s forwards;
}

@keyframes typewriter-reveal {
    from { width: 0; }
    to { width: 100%; }
}

.cursor {
    display: inline-block;
    color: var(--medium-green);
    animation: blink-cursor 0.8s step-end infinite;
    font-weight: 400;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.header-subtitle {
    font-size: 0.8rem;
    color: var(--sage);
}

.header-right {
    display: flex;
    gap: 12px;
}

/* Glass Button */
.glass-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--near-white);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.glass-btn-primary {
    background: rgba(45, 122, 45, 0.3);
    border-color: rgba(45, 122, 45, 0.4);
}

.glass-btn-primary:hover {
    background: rgba(45, 122, 45, 0.45);
    border-color: rgba(45, 122, 45, 0.6);
}

/* Widgets */
#widgets {
    grid-area: widgets;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 24px 32px 0;
}

.widget {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.widget-icon {
    width: 48px;
    height: 48px;
    background: rgba(45, 122, 45, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.widget-data {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.widget-value {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--near-white);
    line-height: 1.2;
}

.widget-label {
    font-size: 0.8rem;
    color: var(--sage);
    font-weight: 500;
}

/* Main Content */
#main-content {
    grid-area: main;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
    padding: 24px 32px 32px;
}

#panel-upcoming {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
}

#panel-analytics {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

#panel-activity {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
}

#panel-compose {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

/* Panel */
.panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.panel:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--near-white);
}

.panel-title svg {
    color: var(--medium-green);
    flex-shrink: 0;
}

.badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    background: rgba(45, 122, 45, 0.2);
    border: 1px solid rgba(45, 122, 45, 0.3);
    border-radius: 20px;
    color: var(--mint-glass);
}

.panel-body {
    padding: 16px 20px;
    flex: 1;
    overflow-y: auto;
}

/* Post Items */
.post-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease;
}

.post-item:last-child {
    border-bottom: none;
}

.post-item:hover {
    background: rgba(255, 255, 255, 0.02);
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
}

.post-time {
    font-size: 0.75rem;
    color: var(--sage);
    width: 72px;
    flex-shrink: 0;
}

.post-content {
    flex: 1;
    min-width: 0;
}

.post-platform {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.post-platform.twitter {
    background: rgba(29, 161, 242, 0.15);
    color: #1da1f2;
}

.post-platform.instagram {
    background: rgba(225, 48, 108, 0.15);
    color: #e1306c;
}

.post-platform.linkedin {
    background: rgba(0, 119, 181, 0.15);
    color: #0077b5;
}

.post-text {
    font-size: 0.85rem;
    color: rgba(244, 249, 244, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
}

.post-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-ready {
    background: rgba(45, 122, 45, 0.2);
    color: var(--mint-glass);
}

.status-review {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.status-draft {
    background: rgba(122, 158, 122, 0.15);
    color: var(--sage);
}

/* Chart */
.chart-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    height: 200px;
    padding-top: 16px;
}

.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
    justify-content: flex-end;
}

.bar-fill {
    width: 100%;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, var(--medium-green), rgba(45, 122, 45, 0.4));
    transition: height 1s cubic-bezier(0.22, 1, 0.36, 1);
    height: 0;
    min-height: 4px;
    position: relative;
}

.bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.15), transparent);
    border-radius: 6px 6px 0 0;
}

.bar-label {
    font-size: 0.7rem;
    color: var(--sage);
}

/* Activity Feed */
.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: opacity 0.3s ease;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 8px;
    height: 8px;
    background: var(--medium-green);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.activity-item:first-child .activity-dot {
    animation: pulse-dot 2s ease-in-out infinite;
}

.activity-info {
    flex: 1;
}

.activity-text {
    font-size: 0.85rem;
    color: rgba(244, 249, 244, 0.8);
    line-height: 1.4;
}

.activity-text strong {
    color: var(--near-white);
    font-weight: 600;
}

.activity-time {
    font-size: 0.7rem;
    color: var(--sage);
    margin-top: 2px;
    display: block;
}

/* Compose */
.compose-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#compose-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--near-white);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s ease;
    line-height: 1.5;
}

#compose-textarea::placeholder {
    color: var(--sage);
    opacity: 0.6;
}

#compose-textarea:focus {
    outline: none;
    border-color: rgba(45, 122, 45, 0.5);
    background: rgba(255, 255, 255, 0.06);
}

.compose-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.platform-toggles {
    display: flex;
    gap: 8px;
}

.platform-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--sage);
    cursor: pointer;
    transition: all 0.2s ease;
}

.platform-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--near-white);
}

.platform-btn.active {
    background: rgba(45, 122, 45, 0.2);
    border-color: rgba(45, 122, 45, 0.4);
    color: var(--medium-green);
}

.compose-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.char-count {
    font-size: 0.75rem;
    color: var(--sage);
}

/* Panel entry animations */
.panel {
    opacity: 0;
    transform: translateY(20px);
    animation: panel-enter 0.5s ease forwards;
}

.panel:nth-child(1) { animation-delay: 0.1s; }
.panel:nth-child(2) { animation-delay: 0.2s; }
.panel:nth-child(3) { animation-delay: 0.3s; }
.panel:nth-child(4) { animation-delay: 0.4s; }

@keyframes panel-enter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.widget {
    opacity: 0;
    transform: translateY(15px);
    animation: panel-enter 0.4s ease forwards;
}

.widget:nth-child(1) { animation-delay: 0.15s; }
.widget:nth-child(2) { animation-delay: 0.25s; }
.widget:nth-child(3) { animation-delay: 0.35s; }
.widget:nth-child(4) { animation-delay: 0.45s; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(122, 158, 122, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(122, 158, 122, 0.5);
}

/* Responsive */
@media (max-width: 1024px) {
    #dashboard {
        grid-template-areas:
            "header"
            "widgets"
            "main";
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
    }

    #sidebar {
        display: none;
    }

    #widgets {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px;
    }

    #main-content {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    #panel-upcoming,
    #panel-analytics,
    #panel-activity,
    #panel-compose {
        grid-column: 1;
        grid-row: auto;
    }

    #header {
        padding: 16px;
    }
}

@media (max-width: 640px) {
    #widgets {
        grid-template-columns: 1fr;
    }

    .header-title {
        font-size: 1.25rem;
    }

    .header-right {
        flex-direction: column;
        gap: 8px;
    }

    #header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
