/*---------------------------------------------*/
/* BASE STYLES                                 */
/*---------------------------------------------*/
:root {
  --primary-color: #00796b;
  --secondary-color: #f0f2f5;
  --text-color: #333;
}

.app-header .logo {
  color: var(--primary-color);
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #f0f2f5;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Clearfix for floats */
.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/*---------------------------------------------*/
/* LAYOUT AND CONTAINERS                       */
/*---------------------------------------------*/

.app-container {
    padding-top: 60px; /* Space for the fixed header */
    padding-bottom: 60px; /* Space for the fixed footer */
    min-height: 100vh;
    box-sizing: border-box;
}

.main-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}

/* Hide sections by default. JavaScript will show the correct one. */
.main-section {
    display: none;
    opacity: 0;
}

.main-section.active {
    display: block;
    opacity: 1;
}

/*---------------------------------------------*/
/* APP HEADER                                  */
/*---------------------------------------------*/

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-sizing: border-box;
}

.header-brand .logo {
    font-weight: bold;
    font-size: 1.5em;
    color: #00796b;
}

.header-search {
    flex-grow: 1;
    margin: 0 20px;
    display: flex;
    align-items: center;
    position: relative;
}

.header-search input {
    width: 100%;
    max-width: 400px;
    padding: 8px 15px;
    padding-right: 40px; /* Make space for the icon */
    border-radius: 20px;
    border: 1px solid #ddd;
    background-color: #f0f2f5;
    font-size: 1em;
}

.header-search .fa-search {
    position: absolute;
    right: 20px;
    color: #888;
    cursor: pointer;
}

.header-notifications {
    position: relative;
    cursor: pointer;
}

.header-notifications .fa-bell {
    font-size: 1.5em;
    color: #555;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff5252;
    color: white;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 50%;
}

/*---------------------------------------------*/
/* MAIN SECTIONS                               */
/*---------------------------------------------*/

.main-section {
    padding: 20px 0;
}

h2 {
    font-size: 1.8em;
    color: #00796b;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Home and Shorts Containers */
.home-feed-container,
.shorts-grid,
.youtube-content-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    padding: 20px 0;
}

/*---------------------------------------------*/
/* USER PROFILE SECTION                        */
/*---------------------------------------------*/

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 5px;
}

.tab-button {
    background: none;
    border: none;
    padding: 10px 15px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    color: #888;
    transition: color 0.3s ease;
}

.tab-button.active {
    color: #00796b;
    border-bottom: 2px solid #00796b;
}

.tab-pane {
    display: none;
    opacity: 0;
}

.tab-pane.active {
    display: block;
    opacity: 1;
}

.profile-account,
.profile-details,
.profile-security {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.profile-account {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-avatar {
    position: relative;
}

.profile-avatar .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #00796b;
}

.status-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 15px;
    height: 15px;
    background-color: #ccc;
    border-radius: 50%;
    border: 2px solid white;
}

.online-status {
    background-color: #4CAF50;
}

.profile-info h3 {
    margin: 0 0 5px 0;
    color: #222;
}

.profile-info p {
    margin: 0;
    color: #666;
}

.profile-card {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.profile-grid {
    display: grid;
    gap: 20px;
}

.user-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.user-info-item p {
    margin: 0;
}

.btn-toggle-info {
    background: none;
    border: none;
    color: #00796b;
    cursor: pointer;
    font-size: 1em;
}

.accordion {
    background-color: #eee;
    color: #444;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 15px;
    transition: 0.4s;
    border-radius: 5px;
    margin-top: 10px;
}

.accordion:hover {
    background-color: #ccc;
}

.panel {
    padding: 0 18px;
    background-color: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
}

.profile-actions {
    margin-top: 20px;
}

.btn {
    padding: 10px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 1em;
}

.btn-edit-profile {
    background-color: #00796b;
    color: white;
}

/*---------------------------------------------*/
/* AUTHENTICATION FORMS                        */
/*---------------------------------------------*/

.auth-form .form-step {
    display: none;
}

.auth-form .form-step.active {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1em;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: #00796b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #004d40;
}

.btn-otp {
    margin-top: 10px;
}

.otp-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.otp-input {
    width: 40px !important;
    text-align: center;
}

.error-message {
    color: #d32f2f;
    font-size: 0.9em;
    margin-top: 5px;
    display: block;
}

.alert {
    padding: 10px;
    border-radius: 5px;
    font-size: 0.9em;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.alert-danger {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* ======================================= */
/* ---------  BLOGS SECTION ------------*/
/* ======================================= */

/* Ẩn các bài viết mặc định, sẽ được hiển thị bằng JavaScript */
.blog-card {
    display: none;
}

/* Vùng chứa chung cho trang blog */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Các nút danh mục */
.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
    justify-content: center;
}

.category-button {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.category-button:hover,
.category-button.active {
    background-color: var(--secondary-color);
    color: var(--light-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Container cho các bài viết */
.blog-posts-container {
    display: grid;
    grid-template-rows: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;    
}

/* Thẻ bài viết (blog-card) */
.blog-card {    
    background-color: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.25);
}

.post-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.post-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-title {
    color: var(--heading-color);
    font-size: 1.35rem;
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.3;
}

.post-date {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.post-summary {
    font-size: 1rem;
    flex-grow: 1;
    margin-bottom: 20px;
}

/* Metadata và Actions */
.post-meta,
.post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.post-meta {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.post-views {
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-button,
.read-more-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
}

.share-button:hover,
.read-more-link:hover {
    color: #0056b3;
    text-decoration: underline;
    transform: translateX(3px);
}

/* Nút tương tác (Like, Love, Haha, Comment) */
.interaction-buttons {
    display: flex;
    gap: 15px;
}

.interaction-button {
    background-color: transparent;
    border: none;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
}

.interaction-button:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.interaction-button i {
    font-size: 1.1rem;
}

/* Các trạng thái ACTIVE */
/* Nút Like khi được click */
.like-button.active {
    color: #007bff; /* Màu xanh dương */
}

/* Nút Love khi được click */
.love-button.active {
    color: #e83e8c; /* Màu hồng */
}

/* Nút Haha khi được click */
.haha-button.active {
    color: #ffc107; /* Màu vàng */
}

/* Nút Comment khi được click */
.comment-button.active {
    color: #28a745; /* Màu xanh lá */
}

/* ======================================= */
/* ---------  PAGINATION   ------------*/
/* ======================================= */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.pagination-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.pagination-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.pagination-button:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
    color: var(--secondary-color);
    transform: none;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-numbers button {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.page-numbers button.active {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-numbers button:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/*---------------------------------------------*/
/* FOOTER                                      */
/*---------------------------------------------*/

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #ffffff;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.footer-nav {
    display: flex;
    justify-content: space-around;
    height: 100%;
    align-items: center;
}

.footer-nav a {
    flex-grow: 1;
    text-align: center;
    color: #888;
    font-size: 1.2em;
    transition: color 0.3s ease;
}

.footer-nav a.active {
    color: #00796b;
}

.footer-nav a:hover {
    color: #00796b;
}

/* This is a separate footer from the one at the bottom of the page */
.main-footer {
    background-color: #222;
    color: #ccc;
    padding: 40px 20px;
    text-align: center;
}

.footer-content {
    max-width: 960px;
    margin: 0 auto;
}

.footer-links a,
.footer-social-media a {
    color: #ccc;
    margin: 0 10px;
    font-size: 1em;
    transition: color 0.3s ease;
}

.footer-links a:hover,
.footer-social-media a:hover {
    color: #fff;
}

.footer-copyright {
    margin-top: 20px;
    font-size: 0.9em;
}

.footer-social-media {
    margin: 20px 0;
}

.footer-social-media a i {
    font-size: 1.5em;
}

.footer-language-selector {
    margin-top: 20px;
    font-size: 0.9em;
}

.lang-select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #f0f2f5;
}

/*---------------------------------------------*/
/* MODALS                                      */
/*---------------------------------------------*/

.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    padding-top: 60px;
}

.modal.active {
    display: block;
}

.modal-dialog {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.close-button {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #000;
}