/**
 * Tech Video Pitch - Frontend Styles
 *
 * @package TechVideoPitch
 */

/* ==========================================================================
   Hide Subnav Bar for Tech Video Pitch
   ========================================================================== */

/* Hide the entire subnav when on tech-video-pitch component */
body.tech-video-pitch #subnav {
    display: none !important;
}

/* ==========================================================================
   Video Wrapper (Responsive)
   ========================================================================== */

.tvp-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin-bottom: 20px;
    border-radius: 8px;
    background: #000;
}

.tvp-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   BuddyPress Profile Content
   ========================================================================== */

.tvp-profile-content {
    max-width: 100%;
}

/* No Pitch State */
.tvp-no-pitch {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.tvp-no-pitch h3 {
    margin: 0 0 15px;
    font-size: 20px;
    color: #333;
}

.tvp-no-pitch p {
    margin: 0 0 20px;
    color: #666;
}

.tvp-no-content {
    color: #888;
    font-style: italic;
}

/* ==========================================================================
   Status Box
   ========================================================================== */

.tvp-status-box {
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    background: #f9f9f9;
    border-left: 4px solid #ccc;
}

.tvp-status-box h3 {
    margin: 0 0 15px;
    font-size: 18px;
}

.tvp-status-label {
    margin: 8px 0;
    font-size: 14px;
}

.tvp-status-label span {
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    color: #fff;
}

/* Status colors */
.tvp-status-box.tvp-status-tvp_pending {
    border-left-color: #f0ad4e;
    background: #fcf8e3;
}

.tvp-status-box.tvp-status-publish {
    border-left-color: #5cb85c;
    background: #dff0d8;
}

.tvp-status-box.tvp-status-tvp_expired {
    border-left-color: #777;
    background: #f5f5f5;
}

.tvp-status-box.tvp-status-tvp_rejected {
    border-left-color: #d9534f;
    background: #f2dede;
}

.tvp-status-label .tvp-status-tvp_pending {
    background: #f0ad4e;
}

.tvp-status-label .tvp-status-publish {
    background: #5cb85c;
}

.tvp-status-label .tvp-status-tvp_expired {
    background: #777;
}

.tvp-status-label .tvp-status-tvp_rejected {
    background: #d9534f;
}

.tvp-status-note {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

.tvp-status-note.tvp-status-approved {
    color: #3c763d;
    font-style: normal;
    font-weight: 500;
}

.tvp-rejection-reason {
    color: #a94442;
    font-style: normal;
}

/* ==========================================================================
   Pitch Preview
   ========================================================================== */

.tvp-pitch-preview {
    margin-bottom: 30px;
}

.tvp-pitch-preview h3 {
    margin: 0 0 20px;
    font-size: 24px;
    color: #333;
}

.tvp-video-container {
    margin-bottom: 20px;
}

.tvp-video-provider {
    font-size: 12px;
    color: #999;
    text-align: right;
    margin-top: -15px;
    margin-bottom: 20px;
}

.tvp-pitch-description {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 20px;
}

.tvp-pitch-description h4 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #333;
}

.tvp-pitch-description p {
    margin: 0 0 10px;
    color: #555;
    line-height: 1.6;
}

.tvp-pitch-description p:last-child {
    margin-bottom: 0;
}

.tvp-pitch-meta {
    font-size: 13px;
    color: #888;
}

/* ==========================================================================
   Actions
   ========================================================================== */

.tvp-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.tvp-actions .button {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.tvp-actions .button:hover {
    background: #005a87;
    color: #fff;
}

/* ==========================================================================
   Edit Form
   ========================================================================== */

.tvp-edit-form-container {
    max-width: 700px;
}

.tvp-edit-form-container h3 {
    margin: 0 0 25px;
    font-size: 24px;
}

.tvp-no-membership {
    padding: 40px 20px;
    text-align: center;
    background: #f5f5f5;
    border-radius: 8px;
}

.tvp-no-membership h3 {
    margin: 0 0 15px;
    color: #333;
}

.tvp-no-membership p {
    margin: 0;
    color: #666;
}

/* Form Messages */
.tvp-form-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.tvp-message-success {
    background: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.tvp-message-error {
    background: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

/* Edit Notice */
.tvp-edit-notice {
    padding: 15px;
    background: #fcf8e3;
    border: 1px solid #faebcc;
    border-radius: 8px;
    margin-bottom: 20px;
}

.tvp-edit-notice p {
    margin: 0;
    color: #8a6d3b;
    font-size: 13px;
}

/* Form Styles */
.tvp-edit-form {
    background: #fff;
    padding: 25px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.tvp-form-field {
    margin-bottom: 25px;
}

.tvp-form-field > label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.tvp-form-field .required {
    color: #d9534f;
}

.tvp-form-field input[type="text"],
.tvp-form-field input[type="url"],
.tvp-form-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.tvp-form-field input[type="text"]:focus,
.tvp-form-field input[type="url"]:focus,
.tvp-form-field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.tvp-field-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

/* Video Preview */
.tvp-video-preview {
    margin-top: 15px;
}

.tvp-video-preview:empty {
    display: none;
}

/* Form Actions */
.tvp-form-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.tvp-submit-btn {
    padding: 12px 24px !important;
    background: #0073aa !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-decoration: none !important;
}

.tvp-submit-btn:hover {
    background: #005a87 !important;
    color: #fff !important;
}

.tvp-submit-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
}

.tvp-form-status {
    font-size: 14px;
}

.tvp-form-status.success {
    color: #5cb85c;
}

.tvp-form-status.error {
    color: #d9534f;
}

/* Approval Notice */
.tvp-approval-notice {
    margin-top: 15px;
    font-size: 13px;
    color: #888;
    font-style: italic;
}

/* ==========================================================================
   Shortcode Display - Grid
   ========================================================================== */

.tvp-pitches-grid {
    display: grid;
    gap: 30px;
    margin: 20px 0;
}

.tvp-pitches-grid.tvp-columns-1 {
    grid-template-columns: 1fr;
}

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

.tvp-pitches-grid.tvp-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.tvp-pitches-grid.tvp-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive grid */
@media (max-width: 991px) {
    .tvp-pitches-grid.tvp-columns-3,
    .tvp-pitches-grid.tvp-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .tvp-pitches-grid.tvp-columns-2,
    .tvp-pitches-grid.tvp-columns-3,
    .tvp-pitches-grid.tvp-columns-4 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Pitch Card
   ========================================================================== */

.tvp-pitch-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.tvp-pitch-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
}

.tvp-pitch-thumbnail {
    position: relative;
    padding-bottom: 56.25%;
    background: #000;
    overflow: hidden;
}

.tvp-pitch-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.tvp-pitch-card:hover .tvp-play-overlay {
    opacity: 1;
}

.tvp-play-button {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tvp-play-button::after {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #333;
    margin-left: 4px;
}

.tvp-pitch-card-content {
    padding: 20px;
}

.tvp-pitch-card-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.tvp-pitch-card-title a {
    color: inherit;
    text-decoration: none;
}

.tvp-pitch-card-title a:hover {
    color: #0073aa;
}

.tvp-pitch-card-excerpt {
    margin: 0 0 15px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.tvp-pitch-card-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: #888;
}

.tvp-pitch-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tvp-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.tvp-author-name a {
    color: #666;
    text-decoration: none;
}

.tvp-author-name a:hover {
    color: #0073aa;
}

/* ==========================================================================
   Single Pitch Modal (Optional)
   ========================================================================== */

.tvp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tvp-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tvp-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.tvp-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tvp-modal-content {
    padding: 30px;
}

/* ==========================================================================
   No Pitches
   ========================================================================== */

.tvp-no-pitches {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.tvp-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.tvp-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: tvp-spin 0.8s linear infinite;
}

@keyframes tvp-spin {
    to {
        transform: rotate(360deg);
    }
}
