/* ============================================================
   TEMPLATE STYLES - Styles for page templates
   Used by PageTemplates.js to render API data
   ============================================================ */

/* ============================================================
   VIDEO FEED STYLES
   ============================================================ */

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 10px;
}

.video-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.15);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #f0f0f0;
}

.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-card:hover .video-overlay {
    opacity: 1;
}

.play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(254, 44, 85, 0.9);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.play-btn:hover {
    background: #fe2c55;
    transform: scale(1.1);
}

.video-info {
    padding: 12px;
}

.video-title {
    display: block;
    color: #333;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 6px;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-title:hover {
    color: #fe2c55;
}

.creator-name {
    display: block;
    color: #666;
    font-size: 12px;
    text-decoration: none;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.creator-name:hover {
    color: #fe2c55;
}

.video-stats {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: #999;
}

.video-stats .stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================================
   VIDEO DETAIL STYLES
   ============================================================ */

.video-player-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: #000;
    margin-bottom: 20px;
}

.video-player {
    width: 100%;
    height: auto;
    max-height: 80vh;
}

.video-detail-info {
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 20px;
}

.video-detail-info .video-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333;
}

.video-actions {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 20px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn:hover {
    background: #fe2c55;
    color: white;
    border-color: #fe2c55;
}

.action-btn span {
    font-size: 18px;
}

.video-stats-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 20px;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin: 20px 0;
}

.stat {
    text-align: center;
}

.stat .label {
    display: block;
    color: #999;
    font-size: 12px;
    margin-bottom: 5px;
}

.stat .value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.video-description {
    margin: 20px 0;
}

.video-description h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

.video-description p {
    color: #666;
    line-height: 1.6;
    white-space: pre-wrap;
}

.creator-info-card {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    align-items: center;
    margin-top: 20px;
}

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

.creator-details {
    flex: 1;
}

.creator-details h3 {
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #333;
    margin-bottom: 5px;
}

.creator-details h3:hover {
    color: #fe2c55;
}

.follower-count {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.follow-btn {
    padding: 8px 16px;
    background: #fe2c55;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.follow-btn:hover {
    background: #d41d45;
}

/* ============================================================
   PROFILE STYLES
   ============================================================ */

.profile-header {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fe2c55;
}

.profile-basic-info h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #333;
}

.username {
    color: #999;
    font-size: 16px;
    margin-bottom: 10px;
}

.verified-badge {
    display: inline-block;
    background: #fe2c55;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.profile-bio {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    line-height: 1.6;
    color: #666;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.profile-stats .stat {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-stats .label {
    display: block;
    color: #999;
    font-size: 12px;
    margin-bottom: 8px;
}

.profile-stats .value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.profile-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.btn-primary {
    background: #fe2c55;
    color: white;
}

.btn-primary:hover {
    background: #d41d45;
}

.btn-secondary {
    background: white;
    color: #fe2c55;
    border: 2px solid #fe2c55;
}

.btn-secondary:hover {
    background: #fee;
}

.profile-videos {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.profile-videos h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
}

/* ============================================================
   MESSAGE STYLES
   ============================================================ */

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #f0f0f0;
}

.message-item {
    background: white;
    padding: 15px;
    display: flex;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.message-item:hover {
    background: #f9f9f9;
}

.message-item.unread {
    background: #fef9f9;
    border-left: 3px solid #fe2c55;
}

.message-item .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

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

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.sender-name {
    font-weight: 600;
    color: #333;
    text-decoration: none;
}

.sender-name:hover {
    color: #fe2c55;
}

.message-time {
    font-size: 12px;
    color: #999;
}

.message-preview {
    font-size: 13px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-btn {
    padding: 8px 15px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s ease;
}

.message-btn:hover {
    background: #fe2c55;
    color: white;
}

/* Chat Window Styles */

.chat-header {
    display: flex;
    gap: 12px;
    padding: 15px;
    background: white;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.chat-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-user-info h3 {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.chat-user-info p {
    margin: 0;
    font-size: 12px;
    color: #999;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chat-message.sent {
    align-items: flex-end;
}

.chat-message.received {
    align-items: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 8px;
    word-wrap: break-word;
    line-height: 1.4;
}

.chat-message.sent .message-bubble {
    background: #fe2c55;
    color: white;
}

.chat-message.received .message-bubble {
    background: #f0f0f0;
    color: #333;
}

.message-time {
    font-size: 11px;
    color: #999;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}

.message-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s ease;
}

.message-input:focus {
    border-color: #fe2c55;
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fe2c55;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.send-btn:hover {
    background: #d41d45;
}

/* ============================================================
   PRODUCT STYLES
   ============================================================ */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 15px;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    width: 100%;
    height: 200px;
    background: #f0f0f0;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.out-of-stock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
}

.product-info {
    padding: 15px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-description {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.product-pricing {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.price {
    font-size: 18px;
    font-weight: 700;
    color: #fe2c55;
}

.original-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

.btn-add-to-cart {
    width: 100%;
    padding: 10px;
    background: #fe2c55;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-add-to-cart:hover:not(:disabled) {
    background: #d41d45;
}

.btn-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Product Detail */

.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 30px;
    background: white;
    border-radius: 8px;
    max-width: 1000px;
    margin: 0 auto;
}

.product-images {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-images .main-image {
    width: 100%;
    border-radius: 8px;
    object-fit: cover;
    background: #f0f0f0;
}

.product-details h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}

.category {
    color: #999;
    font-size: 14px;
    margin-bottom: 15px;
    text-transform: capitalize;
}

.pricing-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.price {
    font-size: 32px;
    font-weight: 700;
    color: #fe2c55;
}

.in-stock,
.out-of-stock {
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.out-of-stock {
    background: #ffebee;
    color: #c62828;
}

.description h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 10px 0;
}

.description p {
    color: #666;
    line-height: 1.6;
}

.product-actions {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.quantity-input {
    width: 70px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.product-actions .btn-primary {
    flex: 1;
}

.shipping-info {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-top: 20px;
}

.shipping-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.shipping-info p {
    font-size: 13px;
    color: #666;
}

/* ============================================================
   CART STYLES
   ============================================================ */

.empty-cart {
    padding: 40px;
    text-align: center;
    color: #999;
    font-size: 16px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: white;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

.cart-item img {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    object-fit: cover;
}

.item-details {
    flex: 1;
}

.item-details h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.item-details .price {
    color: #fe2c55;
    font-weight: 600;
}

.quantity-control {
    display: flex;
    gap: 5px;
    align-items: center;
}

.quantity-control button {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.quantity-control button:hover {
    background: #f0f0f0;
}

.quantity-control input {
    width: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
}

.item-total {
    min-width: 80px;
    text-align: right;
    font-weight: 600;
    color: #333;
}

.remove-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s ease;
}

.remove-btn:hover {
    color: #f44336;
}

.cart-summary {
    background: white;
    padding: 20px;
    border-top: 2px solid #eee;
    margin-top: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.summary-row.total {
    font-size: 18px;
    font-weight: 700;
    border: none;
    padding-top: 10px;
    margin-bottom: 15px;
    color: #333;
}

.btn-checkout {
    width: 100%;
    padding: 15px;
    background: #fe2c55;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-checkout:hover {
    background: #d41d45;
}

/* ============================================================
   NOTIFICATION STYLES
   ============================================================ */

.notification-item {
    display: flex;
    gap: 12px;
    padding: 15px;
    background: white;
    border-left: 4px solid #e0e0e0;
    margin-bottom: 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notification-item.unread {
    background: #fef9f9;
    border-left-color: #fe2c55;
    box-shadow: 0 2px 8px rgba(254, 44, 85, 0.1);
}

.notif-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.notif-content {
    flex: 1;
}

.notif-content h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #333;
}

.notif-content p {
    margin: 0 0 5px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.notif-time {
    font-size: 11px;
    color: #999;
}

.close-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #999;
}

/* ============================================================
   DASHBOARD STYLES
   ============================================================ */

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

.dashboard-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dashboard-card h3 {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px 0;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 12px;
    color: #4caf50;
    margin: 0;
}

.recent-videos-section,
.analytics-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.recent-videos-section h2,
.analytics-section h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

.chart-placeholder {
    background: #f5f5f5;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    color: #999;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   SEARCH RESULTS STYLES
   ============================================================ */

.search-section {
    margin-bottom: 30px;
}

.search-section h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.creators-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.creator-search-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.creator-search-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.creator-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 12px;
}

.creator-search-item h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.creator-search-item p {
    font-size: 12px;
    color: #999;
    margin: 0 0 8px 0;
}

.follower-count {
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
}

.creator-search-item button {
    width: 100%;
    padding: 8px;
    background: #fe2c55;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.creator-search-item button:hover {
    background: #d41d45;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.empty-results {
    padding: 40px;
    text-align: center;
    color: #999;
    font-size: 16px;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
    }

    .product-detail-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chat-message .message-bubble {
        max-width: 85%;
    }

    .products-grid,
    .creators-list,
    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 6px;
    }

    .profile-stats,
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-actions {
        flex-direction: column;
    }

    .video-actions {
        flex-direction: column;
    }

    .action-btn {
        flex: 1 100%;
    }

    .products-grid,
    .creators-list,
    .search-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .message-bubble {
        max-width: 100%;
    }
}
