/**
 * Community Stories Styles - RevvedUpCars Brand Redesign
 * Version 4.0.0 - Clean, professional, on-brand styling
 * Brand Colors: Primary #C5D631 (Lime), Dark #1a1f1a, Light #f8faf8
 */

/* =============================================================================
   SHARE STORY TRIGGER BUTTON
============================================================================= */

.share-story-trigger {
    text-align: center;
    padding: 48px 24px;
    background: linear-gradient(135deg, #f8faf8 0%, #ffffff 100%);
    border-radius: 16px;
    margin-bottom: 32px;
    border: 2px solid #e8ebe8;
    transition: all 0.3s ease;
}

[data-theme="dark"] .share-story-trigger {
    background: linear-gradient(135deg, #1a1f1a 0%, #252a25 100%);
    border-color: #333;
}

.share-story-trigger:hover {
    border-color: #C5D631;
    box-shadow: 0 8px 32px rgba(197, 214, 49, 0.15);
}

.btn-share-story {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 36px;
    background: linear-gradient(135deg, #C5D631 0%, #a8b82a 100%);
    color: #1a1f1a;
    border: none;
    border-radius: 50px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(197, 214, 49, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-share-story:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(197, 214, 49, 0.5);
    background: linear-gradient(135deg, #d4e540 0%, #C5D631 100%);
}

.btn-share-story:active {
    transform: translateY(-1px);
}

.btn-share-story svg {
    flex-shrink: 0;
    stroke: #1a1f1a;
}

.trigger-subtext {
    margin: 18px 0 0;
    color: #666;
    font-size: 15px;
    font-weight: 500;
}

[data-theme="dark"] .trigger-subtext {
    color: rgba(255, 255, 255, 0.7);
}

/* =============================================================================
   MODAL OVERLAY & CONTAINER
============================================================================= */

.story-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 31, 26, 0.92);
    z-index: 99999;
    overflow-y: auto;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.story-modal-overlay.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    opacity: 1;
}

.story-modal {
    position: relative;
    width: 100%;
    max-width: 640px;
    background: #ffffff;
    border-radius: 20px;
    margin: 40px auto;
    box-shadow: 0 32px 96px rgba(0, 0, 0, 0.35);
    animation: modalSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

[data-theme="dark"] .story-modal {
    background: #1e1e1e;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

[data-theme="dark"] .modal-close {
    background: #333;
}

.modal-close:hover {
    background: #C5D631;
    transform: rotate(90deg);
}

.modal-close svg {
    color: #1a1f1a;
    width: 20px;
    height: 20px;
}

[data-theme="dark"] .modal-close svg {
    color: #fff;
}

[data-theme="dark"] .modal-close:hover svg {
    color: #1a1f1a;
}

/* =============================================================================
   MODAL HEADER
============================================================================= */

.modal-header {
    padding: 40px 40px 28px;
    text-align: center;
    background: linear-gradient(135deg, #f8faf8 0%, #fff 100%);
    border-bottom: 1px solid #e8ebe8;
}

[data-theme="dark"] .modal-header {
    background: linear-gradient(135deg, #252a25 0%, #1e1e1e 100%);
    border-color: #333;
}

.modal-header h2 {
    color: #1a1f1a;
    font-size: 26px;
    margin: 0 0 8px;
    font-weight: 800;
}

[data-theme="dark"] .modal-header h2 {
    color: #fff;
}

.modal-header p {
    color: #666;
    font-size: 15px;
    margin: 0;
}

[data-theme="dark"] .modal-header p {
    color: rgba(255, 255, 255, 0.7);
}

.story-notice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 18px;
    background: rgba(197, 214, 49, 0.15);
    border: 1px solid rgba(197, 214, 49, 0.3);
    border-radius: 24px;
    color: #5a6b2a;
    font-size: 13px;
    font-weight: 600;
}

[data-theme="dark"] .story-notice {
    background: rgba(197, 214, 49, 0.1);
    color: #C5D631;
}

.story-notice strong {
    color: #C5D631;
}

/* =============================================================================
   FORM STYLES
============================================================================= */

.story-submission-form {
    padding: 32px 40px 40px;
}

[data-theme="dark"] .story-submission-form {
    background: #1e1e1e;
}

.form-section {
    margin-bottom: 28px;
}

.form-section h3 {
    color: #1a1f1a;
    font-size: 16px;
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .form-section h3 {
    color: #fff;
}

.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #C5D631 0%, #a8b82a 100%);
    color: #1a1f1a;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-field {
    margin-bottom: 18px;
}

.form-row .form-field {
    margin-bottom: 0;
}

.form-field label {
    display: block;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

[data-theme="dark"] .form-field label {
    color: rgba(255, 255, 255, 0.85);
}

.form-field .required {
    color: #d63638;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 14px 16px;
    background: #f8faf8;
    border: 2px solid #e8ebe8;
    border-radius: 10px;
    color: #1a1f1a;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
}

[data-theme="dark"] .form-field input[type="text"],
[data-theme="dark"] .form-field input[type="email"],
[data-theme="dark"] .form-field select,
[data-theme="dark"] .form-field textarea {
    background: #252a25;
    border-color: #444;
    color: #fff;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #C5D631;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(197, 214, 49, 0.15);
}

[data-theme="dark"] .form-field input:focus,
[data-theme="dark"] .form-field select:focus,
[data-theme="dark"] .form-field textarea:focus {
    background: #2a2a2a;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: #999;
}

[data-theme="dark"] .form-field input::placeholder,
[data-theme="dark"] .form-field textarea::placeholder {
    color: #666;
}

.form-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.form-field select option {
    background: #fff;
    color: #1a1f1a;
}

[data-theme="dark"] .form-field select option {
    background: #1e1e1e;
    color: #fff;
}

.form-field small {
    display: block;
    margin-top: 6px;
    color: #888;
    font-size: 12px;
}

[data-theme="dark"] .form-field small {
    color: #666;
}

.form-field input[type="file"] {
    padding: 12px;
    cursor: pointer;
}

.form-field input[type="file"]::-webkit-file-upload-button {
    background: #C5D631;
    color: #1a1f1a;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 12px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.form-field input[type="file"]::-webkit-file-upload-button:hover {
    background: #d4e540;
}

/* Terms checkbox */
.form-section-terms {
    padding: 18px 20px;
    background: #f8faf8;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #e8ebe8;
}

[data-theme="dark"] .form-section-terms {
    background: #252a25;
    border-color: #333;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: #444;
    font-size: 14px;
    font-weight: 500;
}

[data-theme="dark"] .checkbox-label {
    color: rgba(255, 255, 255, 0.8);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #C5D631;
}

/* Form actions */
.form-actions {
    text-align: center;
}

.btn-submit-story {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 48px;
    background: linear-gradient(135deg, #C5D631 0%, #a8b82a 100%);
    color: #1a1f1a;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(197, 214, 49, 0.35);
}

.btn-submit-story:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(197, 214, 49, 0.5);
    background: linear-gradient(135deg, #d4e540 0%, #C5D631 100%);
}

.btn-submit-story:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit-story:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Form messages */
.form-message {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.form-message.success {
    background: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

[data-theme="dark"] .form-message.success {
    background: rgba(76, 175, 80, 0.15);
    color: #66bb6a;
}

.form-message.error {
    background: rgba(244, 67, 54, 0.1);
    color: #c62828;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

[data-theme="dark"] .form-message.error {
    background: rgba(244, 67, 54, 0.15);
    color: #ef5350;
}

/* =============================================================================
   SUCCESS MESSAGE
============================================================================= */

.story-success-message {
    text-align: center;
    padding: 64px 32px;
    background: linear-gradient(135deg, #f8faf8 0%, #fff 100%);
    border-radius: 20px;
    margin-bottom: 32px;
    border: 2px solid #e8ebe8;
}

[data-theme="dark"] .story-success-message {
    background: linear-gradient(135deg, #1a1f1a 0%, #252a25 100%);
    border-color: #333;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: rgba(197, 214, 49, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon svg {
    color: #C5D631;
    width: 40px;
    height: 40px;
}

.story-success-message h3 {
    color: #1a1f1a;
    font-size: 28px;
    margin: 0 0 12px;
    font-weight: 800;
}

[data-theme="dark"] .story-success-message h3 {
    color: #fff;
}

.story-success-message p {
    color: #666;
    font-size: 16px;
    margin: 0 0 28px;
    line-height: 1.6;
}

[data-theme="dark"] .story-success-message p {
    color: rgba(255, 255, 255, 0.7);
}

.btn-submit-another {
    display: inline-block;
    padding: 14px 32px;
    background: #1a1f1a;
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

[data-theme="dark"] .btn-submit-another {
    background: #333;
}

.btn-submit-another:hover {
    background: #333;
    color: #fff;
    transform: translateY(-2px);
}

[data-theme="dark"] .btn-submit-another:hover {
    background: #444;
}

/* =============================================================================
   STORIES DISPLAY SECTION
============================================================================= */

.community-stories-section {
    margin: 48px 0;
}

.stories-header {
    text-align: center;
    margin-bottom: 40px;
}

.stories-header h3 {
    color: #1a1f1a;
    font-size: 28px;
    margin: 0 0 10px;
    font-weight: 800;
}

[data-theme="dark"] .stories-header h3 {
    color: #fff;
}

.stories-header p {
    color: #666;
    font-size: 15px;
    margin: 0;
}

[data-theme="dark"] .stories-header p {
    color: rgba(255, 255, 255, 0.6);
}

.community-stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

/* Story Card */
.story-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e8ebe8;
}

[data-theme="dark"] .story-card {
    background: #1e1e1e;
    border-color: #333;
}

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

[data-theme="dark"] .story-card:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.story-card.story-featured {
    border-color: #C5D631;
    box-shadow: 0 0 0 1px #C5D631;
}

.story-card-link {
    display: block;
    text-decoration: none;
}

.story-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

[data-theme="dark"] .story-card-image {
    background: #252a25;
}

.story-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.story-card:hover .story-card-image img {
    transform: scale(1.05);
}

.story-time-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    background: rgba(26, 31, 26, 0.85);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.story-featured-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #C5D631 0%, #a8b82a 100%);
    color: #1a1f1a;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
}

.story-category-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 5px 12px;
    background: rgba(26, 31, 26, 0.8);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.story-card-content {
    padding: 22px;
}

.story-card-title {
    color: #1a1f1a;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.4;
}

[data-theme="dark"] .story-card-title {
    color: #fff;
}

.story-vehicle {
    color: #5a6b2a;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

[data-theme="dark"] .story-vehicle {
    color: #C5D631;
}

.story-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 16px;
}

[data-theme="dark"] .story-excerpt {
    color: rgba(255, 255, 255, 0.6);
}

.story-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.story-author {
    color: #333;
    font-size: 13px;
    font-weight: 600;
}

[data-theme="dark"] .story-author {
    color: rgba(255, 255, 255, 0.85);
}

.story-location {
    color: #888;
    font-size: 12px;
}

[data-theme="dark"] .story-location {
    color: rgba(255, 255, 255, 0.5);
}

.story-card-footer {
    padding: 14px 22px;
    border-top: 1px solid #e8ebe8;
    background: #f8faf8;
}

[data-theme="dark"] .story-card-footer {
    border-color: #333;
    background: #252a25;
}

.story-comments {
    color: #888;
    font-size: 13px;
    font-weight: 500;
}

[data-theme="dark"] .story-comments {
    color: rgba(255, 255, 255, 0.5);
}

/* No Stories State */
.no-stories {
    grid-column: 1 / -1;
    text-align: center;
    padding: 64px 32px;
    background: #f8faf8;
    border-radius: 16px;
    border: 2px dashed #e0e5e0;
}

[data-theme="dark"] .no-stories {
    background: #1e1e1e;
    border-color: #333;
}

.no-stories svg {
    color: #ccc;
    margin-bottom: 20px;
}

[data-theme="dark"] .no-stories svg {
    color: #444;
}

.no-stories h3 {
    color: #1a1f1a;
    font-size: 22px;
    margin: 0 0 10px;
    font-weight: 700;
}

[data-theme="dark"] .no-stories h3 {
    color: #fff;
}

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

[data-theme="dark"] .no-stories p {
    color: rgba(255, 255, 255, 0.6);
}

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

@media (max-width: 768px) {
    .share-story-trigger {
        padding: 36px 20px;
    }
    
    .btn-share-story {
        padding: 14px 28px;
        font-size: 15px;
    }
    
    .story-modal {
        margin: 16px auto;
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 32px 24px 24px;
    }
    
    .modal-header h2 {
        font-size: 22px;
    }
    
    .story-submission-form {
        padding: 24px;
    }
    
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-section h3 {
        font-size: 14px;
    }
    
    .community-stories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stories-header h3 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .modal-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }
    
    .modal-header {
        padding: 28px 20px 20px;
    }
    
    .story-submission-form {
        padding: 20px;
    }
    
    .btn-submit-story {
        width: 100%;
        padding: 14px 24px;
    }
    
    .story-card-content {
        padding: 18px;
    }
    
    .story-card-image {
        height: 180px;
    }
}
