/* Base */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.error {
  margin-top: 8px;
  color: #d93025;
  font-size: 0.95rem;
}

/* Header */
.header {
    background: rgba(3, 80, 80, 0.15);
    padding: 1rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(3, 80, 80, 0.1);
}
.m-header {
    background: rgba(3, 80, 80, 0.15);
    padding: 0.3rem 0.5rem 0.3rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(3, 80, 80, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.icon-btn {
    background: none;
    border: none;
    color: #035050;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.icon-btn:hover {
    color: #166a6a;
    background-color: rgba(15, 75, 75, 0.15);
    transform: scale(1.1);
}

.icon-btn:focus {
    outline-offset: 2px;
    border-radius: 4px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo {
    height: 40px;
    width: auto;
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #CC5500;
    margin-left: 0.5rem;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #f56200;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Navigation Tabs */
.nav-tabs {
    background: white;
    padding: 0 2rem;
    display: flex;
    gap: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.nav-tab {
    padding: 1rem 0;
    color: #666666;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-tab:hover {
    color: #166a6a;
    border-bottom-color: #b5cdcd;
}

.nav-tab.active {
    color: #166a6a;
    border-bottom-color: #166a6a;
}

.nav-tab:focus {
    outline-offset: 2px;
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Story Cards Grid */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Story Card */
.story-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.story-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Chain Title */
.chain-title {
    font-size: 0.85rem;
    color: #999999;
    margin-bottom: 0.5rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.chain-title:hover {
    color: #166a6a;
    text-decoration: underline;
}

/* Rating */
.rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.star {
    color: #f56200;
    font-size: 0.9rem;
}

.star.empty {
    color: #e0e0e0;
}

/* Segment Title */
.segment-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333333;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* Author Info */
.author-info {
    font-size: 0.9rem;
    color: #666666;
    margin-bottom: 1rem;
}

.author-name {
    color: #4f1059;
    font-weight: 500;
    text-decoration: none;
}

.author-name:hover {
    text-decoration: underline;
}

.timestamp {
    color: #999999;
}

/* Preview Text */
.preview-text {
    font-size: 0.95rem;
    color: #333333;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.continue-btn {
    background-color: #166a6a;
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.continue-btn:hover {
    background-color: #033A50;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(3, 58, 80, 0.3);
}

.continue-btn:focus {
    outline-offset: 2px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.action-icon {
    background: none;
    border: none;
    color: #999999;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.25rem;
}

.action-icon:hover {
    color: #f56200;
    transform: scale(1.15);
}

.action-icon:focus {
    outline-offset: 2px;
    border-radius: 4px;
}

.action-icon.liked {
    color: #f56200;
}

/* Footer */

footer a {
    color: #666666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #166a6a;
}

footer a:focus {
    outline-offset: 2px;
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 1279px) {
    .stories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    header {
        padding: .1rem 2rem;
    }

    .header-left,
    .header-right {
        gap: 1rem;
    }

    .brand-text {
        display: none;
    }

    .nav-tabs {
        padding: 0 1.5rem;
        gap: 1rem;
        overflow-x: auto;
    }

    .nav-tab {
        white-space: nowrap;
        font-size: 0.9rem;
    }

    main {
        padding: 1.5rem;
    }

    .stories-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    footer {
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .icon-btn {
        font-size: 1.1rem;
    }

    .story-card {
        padding: 1.25rem;
    }

    .segment-title {
        font-size: 1.1rem;
    }

    footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Dropdown Menus (Placeholder for future JS implementation) */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333333;
    text-decoration: none;
    transition: background 0.2s ease;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
}
