/**
 * Component Styles - Reusable UI Components
 * Buttons, Forms, Cards, Modals, and other components
 */

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-textarea,
.form-select {
    padding: 15px 20px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
    outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-input.valid {
    border-color: #27ae60;
    animation: pulse 0.3s ease;
}

/* Form error styling */
.form-group input.error,
.form-group textarea.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.field-error {
    display: none;
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    font-weight: 500;
}

.field-error:before {
    content: "⚠ ";
    margin-right: 5px;
}

/* Button Styles */
.submit-btn,
.dashboard-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 30px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.submit-btn:hover,
.dashboard-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.submit-btn:active,
.dashboard-btn:active {
    transform: translateY(0);
}

.dashboard-btn {
    padding: 18px 40px;
    width: auto;
}

.menu-btn {
    background: #fff;
    color: #111;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 16px;
    padding: 8px 22px;
    border: none;
    margin-right: 4px;
    transition: background 0.2s, color 0.2s;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
}

.menu-btn.selected,
.menu-btn:focus {
    background: #111;
    color: #fff;
}

.action-btn {
    background: #111;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 24px;
    padding: 10px 32px;
    border: none;
    margin-left: 8px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
}

.logo-btn {
    background: #111;
    color: #fff;
    font-weight: 700;
    font-size: 1.3rem;
    border-radius: 16px;
    padding: 8px 22px;
    border: none;
    letter-spacing: 2px;
    margin-right: 4px;
    font-family: 'Inter', sans-serif;
}

.discrete-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(102, 126, 234, 0.1);
    color: #495057;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.discrete-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.discrete-btn:active {
    transform: translateY(0);
}

.discrete-btn-icon {
    font-size: 0.7rem;
    opacity: 0.8;
}

.discrete-btn-text {
    font-size: 0.75rem;
}

/* Card Styles */
.earnings-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.earnings-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.clickable-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.clickable-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.clickable-card:hover::before {
    left: 100%;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 150px;
}

.summary-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.summary-value {
    font-size: 1.3rem;
    font-weight: 700;
}

.summary-value.highlight {
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* File Upload Styles */
.file-upload-container {
    position: relative;
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px dashed #e0e6ed;
    border-radius: 12px;
    background: #fafbfc;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 20px;
}

.file-upload-container:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.01);
}

.file-upload-container.has-file {
    border-color: #27ae60;
    background: #f1f8f1;
}

.file-upload-container.has-file:before {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 15px;
    background: #27ae60;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.file-upload-container.drag-over {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.02);
}

.file-info p {
    margin: 0 0 5px 0;
    color: #555;
}

.file-selected {
    color: #27ae60;
}

/* Media Components */
.media-gallery {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.media-thumb {
    border-radius: 10px;
    overflow: hidden;
    border: 1.5px solid #e0e6ed;
    width: 140px;
    height: 140px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-thumb img,
.media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-btn:not(:disabled):hover {
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

/* Modal Styles */
.media-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.media-modal-content {
    position: relative;
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    background: white;
    border-radius: 15px;
    text-align: center;
}

.media-modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.media-modal-close:hover {
    color: #333;
}

#media-modal-body img,
#media-modal-body video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 10px;
}

/* Error and Message Styles */
.error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    animation: shake 0.5s ease-in-out;
}

.general-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 0.9rem;
}

.dev-notice {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.clear-form-btn {
    background: none;
    border: 1px solid #0c5460;
    color: #0c5460;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    float: right;
}

/* Progress Components */
.upload-progress {
    margin-top: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Status Components */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-suspended {
    background: #f5c6cb;
    color: #721c24;
}

.status-responded {
    background: rgba(39, 174, 96, 0.15);
    color: #27ae60;
}

/* Form Section Progress */
.form-section {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
}

.form-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.form-section.completed {
    border-left: 4px solid #27ae60;
}

.form-section.completed h3 {
    color: #27ae60;
}

/* Animation for upload form section */
.upload-form-section.animate-in {
    animation: slideUp 0.6s ease-out;
}

/* Debug Components */
.debug-form {
    width: 100%;
}

.debug-description {
    background: rgba(41, 182, 246, 0.1);
    color: #0277bd;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid #29b6f6;
}

.debug-switch-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.debug-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.debug-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.debug-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.debug-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .debug-slider {
    background-color: #29b6f6;
}

input:focus + .debug-slider {
    box-shadow: 0 0 1px #29b6f6;
}

input:checked + .debug-slider:before {
    transform: translateX(26px);
}

.debug-label {
    color: #0277bd;
    font-weight: 600;
    font-size: 0.9rem;
}

.debug-status {
    text-align: center;
    font-size: 0.8rem;
    color: #0277bd;
    min-height: 20px;
}

.debug-status.active {
    color: #2e7d32;
    font-weight: 600;
}

.debug-status.inactive {
    color: #d32f2f;
}
