/* Phongthuy Forum - Apple-style with Dark Yellow Theme */

:root {
    --ptf-primary: #b8860b; /* Dark goldenrod */
    --ptf-primary-light: #daa520; /* Goldenrod */
    --ptf-primary-dark: #8b6914;
    --ptf-accent: #ffd700; /* Gold */
    --ptf-bg: #fafafa;
    --ptf-bg-white: #ffffff;
    --ptf-text: #1d1d1f;
    --ptf-text-secondary: #86868b;
    --ptf-border: #e5e5e7;
    --ptf-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --ptf-radius: 12px;
    --ptf-radius-sm: 8px;
    --ptf-radius-lg: 16px;
}

/* Reset and Base */
.ptf-forum-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ptf-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.ptf-forum-wrapper * {
    box-sizing: border-box;
}

.ptf-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.ptf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: var(--ptf-bg-white);
    border-radius: var(--ptf-radius-lg);
    box-shadow: var(--ptf-shadow);
}

.ptf-logo {
    display: flex;
    align-items: center;
}

.ptf-logo img {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease;
}

.ptf-logo a:hover img {
    transform: scale(1.05);
}

.ptf-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--ptf-primary-dark);
    margin: 0;
    background: linear-gradient(135deg, var(--ptf-primary-dark), var(--ptf-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ptf-btn-create-topic,
.ptf-btn-login {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--ptf-primary), var(--ptf-primary-light));
    color: white;
    border: none;
    border-radius: var(--ptf-radius-sm);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.ptf-btn-create-topic:hover,
.ptf-btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
}

/* Main Content Layout */
.ptf-main-content {
    display: flex;
    gap: 20px;
}

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

/* Tabs */
.ptf-tabs {
    display: flex;
    gap: 5px;
    padding: 5px;
    background: #f8f9fa;
    border-radius: var(--ptf-radius);
    box-shadow: var(--ptf-shadow);
    margin-bottom: 20px;
}

.ptf-tab {
    flex: 1;
    padding: 10px 20px;
    text-align: center;
    color: #6c757d !important;
    text-decoration: none !important;
    border-radius: var(--ptf-radius-sm);
    font-weight: 500;
    transition: all 0.3s ease;
    background: white !important;
    position: relative;
    border: 1px solid #dee2e6;
    cursor: pointer;
}

.ptf-tab:hover:not(.active) {
    background: #f8f9fa !important;
    color: #495057 !important;
    border-color: #ced4da;
}

.ptf-tab.active,
.ptf-tabs .ptf-tab.active {
    background: linear-gradient(135deg, #b8860b, #daa520) !important;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(184, 134, 11, 0.4);
    transform: translateY(-2px) scale(1.02);
    z-index: 10;
    border-color: #b8860b !important;
}

.ptf-tab.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: #b8860b;
    border-radius: 2px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 40px;
        opacity: 1;
    }
}

/* Topics List */
.ptf-topics-list {
    background: var(--ptf-bg-white);
    border-radius: var(--ptf-radius-lg);
    box-shadow: var(--ptf-shadow);
    overflow: hidden;
}

.ptf-topic-item {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    border-bottom: 1px solid var(--ptf-border);
    transition: background 0.3s ease;
    position: relative;
}

.ptf-topic-item:hover {
    background: var(--ptf-bg);
}

.ptf-topic-item.hot {
    background: linear-gradient(to right, rgba(255, 215, 0, 0.05), transparent);
}

.ptf-topic-item.pinned {
    background: linear-gradient(to right, rgba(184, 134, 11, 0.05), transparent);
}

.ptf-topic-item.rules-topic {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(184, 134, 11, 0.05));
    border: 1px solid rgba(184, 134, 11, 0.2);
    margin-bottom: 15px;
}

.hot-icon {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    animation: flame 1s infinite;
}

@keyframes flame {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
}

.topic-avatar {
    width: 60px;
    margin-right: 15px;
    flex-shrink: 0;
    text-align: center;
}

.topic-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name-below {
    font-size: 11px;
    color: var(--ptf-text-secondary);
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.topic-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
}

.topic-title a {
    color: var(--ptf-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.topic-title a:hover {
    color: var(--ptf-primary);
}

.pinned-badge,
.answered-badge,
.rules-badge {
    display: inline-block;
    margin-left: 8px;
    font-size: 14px;
}

.answered-badge {
    color: #34c759;
    font-weight: normal;
    font-size: 12px;
}

.ignored-badge {
    color: #999;
    font-size: 12px;
}

.pending-badge {
    color: #ff9500;
    font-size: 12px;
}

.topic-title-locked {
    color: var(--ptf-text-secondary);
    cursor: not-allowed;
}

.topic-course {
    margin: 5px 0;
    font-size: 13px;
}

.course-label {
    color: var(--ptf-text-secondary);
}

.course-name {
    color: var(--ptf-primary);
    font-weight: 500;
}

.topic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: var(--ptf-text-secondary);
}

.topic-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.topic-tags {
    margin-top: 10px;
}

.tag {
    display: inline-block;
    padding: 4px 10px;
    margin-right: 8px;
    background: var(--ptf-bg);
    color: var(--ptf-primary);
    border-radius: var(--ptf-radius-sm);
    font-size: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--ptf-primary);
    color: white;
}

/* Sidebar */
.ptf-sidebar {
    width: 320px;
    flex-shrink: 0;
}

.ptf-widget {
    background: var(--ptf-bg-white);
    border-radius: var(--ptf-radius);
    box-shadow: var(--ptf-shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.ptf-widget-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ptf-primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ptf-widget-content {
    font-size: 14px;
}

/* Search Widget */
.ptf-search-form {
    display: flex;
    gap: 10px;
}

.ptf-search-form input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--ptf-border);
    border-radius: var(--ptf-radius-sm);
    font-size: 14px;
}

.ptf-search-form button {
    padding: 10px 15px;
    background: var(--ptf-primary);
    color: white;
    border: none;
    border-radius: var(--ptf-radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.ptf-search-form button:hover {
    background: var(--ptf-primary-dark);
}

/* Member List Widget */
.ptf-member-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ptf-member-list li {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--ptf-border);
}

.ptf-member-list li:last-child {
    border-bottom: none;
}

.ptf-member-list img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

.member-info {
    flex: 1;
}

.member-name {
    display: block;
    font-weight: 500;
    color: var(--ptf-text);
}

.member-date {
    font-size: 12px;
    color: var(--ptf-text-secondary);
}

/* Topic List Widget */
.ptf-topic-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ptf-topic-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--ptf-border);
}

.ptf-topic-list li:last-child {
    border-bottom: none;
}

.ptf-topic-list a {
    color: var(--ptf-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.ptf-topic-list a:hover {
    color: var(--ptf-primary);
}

.topic-meta {
    display: block;
    font-size: 12px;
    color: var(--ptf-text-secondary);
    margin-top: 4px;
}

/* Tag Cloud Widget */
.ptf-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ptf-tag-cloud .ptf-tag {
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.1), rgba(218, 165, 32, 0.1));
    color: var(--ptf-primary-dark);
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.ptf-tag-cloud .ptf-tag:hover {
    background: linear-gradient(135deg, var(--ptf-primary), var(--ptf-primary-light));
    color: white;
    transform: translateY(-2px);
}

/* Hot Courses Widget */
.ptf-hot-courses-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ptf-hot-courses-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--ptf-border);
}

.ptf-hot-courses-list li:last-child {
    border-bottom: none;
}

.ptf-hot-courses-list a {
    color: var(--ptf-text);
    text-decoration: none;
    display: block;
    transition: color 0.3s ease;
}

.ptf-hot-courses-list a:hover {
    color: var(--ptf-primary);
}

.ptf-hot-courses-list .topic-count {
    font-size: 12px;
    color: var(--ptf-text-secondary);
}

.ptf-hot-courses-list .enrolled-badge {
    color: #34c759;
    font-weight: bold;
}

.ptf-hot-courses-list .course-locked {
    color: var(--ptf-text-secondary);
    cursor: not-allowed;
}

.ptf-hot-courses-list .not-enrolled a {
    color: var(--ptf-text-secondary);
}

/* Visitor Stats Widget */
.ptf-visitor-stats .stat-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--ptf-border);
    display: flex;
    justify-content: space-between;
}

.ptf-visitor-stats .stat-row:last-child {
    border-bottom: none;
}

.ptf-visitor-stats .online {
    color: var(--ptf-primary);
    font-weight: 600;
}

/* Pagination */
.ptf-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.page-btn,
.page-num {
    padding: 8px 16px;
    background: var(--ptf-bg-white);
    color: var(--ptf-text);
    text-decoration: none;
    border-radius: var(--ptf-radius-sm);
    border: 1px solid var(--ptf-border);
    transition: all 0.3s ease;
}

.page-btn:hover,
.page-num:hover {
    background: var(--ptf-primary);
    color: white;
    border-color: var(--ptf-primary);
}

.page-num.active {
    background: var(--ptf-primary);
    color: white;
    border-color: var(--ptf-primary);
}

.dots {
    color: var(--ptf-text-secondary);
}

/* Modal */
.ptf-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 9999;
}

.ptf-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ptf-modal-content {
    background: var(--ptf-bg-white);
    border-radius: var(--ptf-radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.ptf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--ptf-border);
}

.ptf-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--ptf-primary-dark);
}

.ptf-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--ptf-bg);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ptf-modal-close:hover {
    background: var(--ptf-primary);
    color: white;
}

/* Form Styles */
#ptf-create-topic-form,
#ptf-reply-form {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--ptf-text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--ptf-border);
    border-radius: var(--ptf-radius-sm);
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--ptf-primary);
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.admin-options {
    background: var(--ptf-bg);
    padding: 15px;
    border-radius: var(--ptf-radius-sm);
    margin-top: 15px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.ptf-btn-submit,
.ptf-btn-cancel {
    padding: 12px 24px;
    border: none;
    border-radius: var(--ptf-radius-sm);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ptf-btn-submit {
    background: linear-gradient(135deg, var(--ptf-primary), var(--ptf-primary-light));
    color: white;
}

.ptf-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
}

.ptf-btn-cancel {
    background: var(--ptf-bg);
    color: var(--ptf-text);
}

.ptf-btn-cancel:hover {
    background: var(--ptf-border);
}

/* Member Names Display */
.ptf-member-names {
    line-height: 1.6;
    color: #8b6914; /* Darker golden brown for better readability */
    padding: 10px 0;
    font-size: 14px;
    word-wrap: break-word;
}

.ptf-member-names strong {
    color: #8b6914; /* Same dark golden for bold names */
    font-weight: 600;
    transition: color 0.3s ease;
}

.ptf-member-names strong:hover {
    color: #b8860b; /* Lighter on hover */
    cursor: default;
}

/* Sidebar Widget Titles */
.ptf-sidebar h2.widgettitle,
.ptf-sidebar h3.ptf-widget-title {
    font-size: 12px !important;
    text-transform: uppercase;
    font-weight: 700;
    color: #8b6914 !important; /* Darker golden for better contrast */
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #b8860b;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .ptf-sidebar h2.widgettitle,
    .ptf-sidebar h3.ptf-widget-title {
        font-size: 11px !important;
    }
}

/* Widget Content Styling */
.ptf-sidebar .widget {
    background: rgba(184, 134, 11, 0.03);
    border-radius: var(--ptf-radius);
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(184, 134, 11, 0.1);
}

.ptf-sidebar .ptf-widget-content {
    background: transparent;
}

/* Topic List in Sidebar */
.ptf-topic-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ptf-topic-list li {
    padding: 8px 0;
    border-bottom: 1px dotted rgba(184, 134, 11, 0.2);
}

.ptf-topic-list li:last-child {
    border-bottom: none;
}

.ptf-topic-list a {
    color: #333;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: block;
    margin-bottom: 3px;
}

.ptf-topic-list a:hover {
    color: #b8860b;
}

.ptf-topic-list .topic-meta {
    display: inline-block;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* Topic Closed Notice */
.ptf-topic-closed {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: var(--ptf-radius-sm);
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

.ptf-topic-closed p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Single Topic View */
.ptf-breadcrumb {
    padding: 15px 20px;
    background: var(--ptf-bg-white);
    border-radius: var(--ptf-radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.ptf-breadcrumb a {
    color: var(--ptf-primary);
    text-decoration: none;
}

.ptf-breadcrumb span {
    color: var(--ptf-text-secondary);
    margin: 0 8px;
}

.ptf-topic-view {
    background: var(--ptf-bg-white);
    border-radius: var(--ptf-radius-lg);
    box-shadow: var(--ptf-shadow);
    overflow: hidden;
}

.ptf-topic-header {
    padding: 30px;
    border-bottom: 1px solid var(--ptf-border);
}

.ptf-topic-header .topic-title {
    font-size: 28px;
    margin-bottom: 15px;
}

.topic-stats {
    display: flex;
    gap: 20px;
    color: var(--ptf-text-secondary);
}

.ptf-topic-content {
    padding: 30px;
    border-bottom: 2px solid var(--ptf-border);
}

.topic-author {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.author-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.author-info {
    margin-left: 15px;
}

.author-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.admin-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, var(--ptf-primary), var(--ptf-primary-light));
    color: white;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
}

.author-stats {
    font-size: 14px;
    color: var(--ptf-text-secondary);
}

.author-stats span {
    margin-right: 15px;
}

.topic-body {
    font-size: 16px;
    line-height: 1.8;
}

/* Replies */
.ptf-replies-section {
    padding: 30px;
}

.replies-title {
    font-size: 22px;
    margin-bottom: 20px;
}

.admin-answered {
    color: #34c759;
    font-size: 16px;
    margin-left: 10px;
}

.ptf-reply-item {
    padding: 20px;
    border-bottom: 1px solid var(--ptf-border);
    transition: background 0.3s ease;
}

.ptf-reply-item:hover {
    background: var(--ptf-bg);
}

.ptf-reply-item.admin-reply {
    background: linear-gradient(to right, rgba(255, 215, 0, 0.05), transparent);
    border-left: 3px solid var(--ptf-primary);
}

.reply-author {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.reply-content {
    margin-left: 63px;
}

.reply-actions {
    margin-top: 15px;
    margin-left: 63px;
}

.like-btn {
    padding: 6px 12px;
    background: var(--ptf-bg);
    border: 1px solid var(--ptf-border);
    border-radius: var(--ptf-radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.like-btn:hover {
    background: var(--ptf-primary);
    color: white;
    border-color: var(--ptf-primary);
}

.like-btn.liked {
    background: var(--ptf-primary);
    color: white;
    border-color: var(--ptf-primary);
}

/* Reply Form */
.ptf-reply-form {
    padding: 30px;
    border-top: 1px solid var(--ptf-border);
}

.ptf-reply-form h3 {
    margin-bottom: 20px;
    color: var(--ptf-primary-dark);
}

.ptf-login-prompt {
    padding: 30px;
    text-align: center;
    background: var(--ptf-bg);
    border-top: 1px solid var(--ptf-border);
}

.ptf-login-prompt a {
    color: var(--ptf-primary);
    font-weight: 600;
}

.moderation-notice {
    padding: 10px 15px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: var(--ptf-radius-sm);
    margin-bottom: 15px;
    font-size: 14px;
}

.ptf-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--ptf-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--ptf-radius-sm);
    transition: all 0.3s ease;
}

.ptf-btn:hover {
    background: var(--ptf-primary-dark);
    transform: translateY(-2px);
}

.notice-box {
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(218, 165, 32, 0.1));
    border-left: 4px solid var(--ptf-primary);
    border-radius: var(--ptf-radius-sm);
}

.notice-box strong {
    color: var(--ptf-primary-dark);
}

/* Admin Styles */
.ptf-dashboard .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    padding: 20px;
    background: linear-gradient(135deg, var(--ptf-primary), var(--ptf-primary-light));
    color: white;
    border-radius: var(--ptf-radius);
    text-align: center;
}

.stat-box h3 {
    margin: 0 0 10px;
    font-size: 14px;
    opacity: 0.9;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
}

.stat-sub {
    font-size: 12px;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .ptf-main-content {
        flex-direction: column;
    }
    
    .ptf-sidebar {
        width: 100%;
    }
    
    .ptf-tabs {
        flex-wrap: wrap;
    }
    
    .ptf-tab {
        flex: 1 1 30%;
        font-size: 14px;
        padding: 8px 10px;
    }
    
    .topic-meta {
        font-size: 12px;
    }
    
    .ptf-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .ptf-logo img {
        height: 40px;
    }
    
    .ptf-title {
        margin-bottom: 15px;
    }
}