/**
 * Shared Styles for Steps1.xyz Application
 * Modern, consistent design system across all pages
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    padding: 10px;
    color: #1e293b;
    line-height: 1.6;
}

/* Main Container */
.main-container {
    max-width: 420px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.main-container.wide {
    max-width: 700px;
}

/* Progress Bar */
.progress-container {
    background: #f1f5f9;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1d4ed8, #1e40af);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 3px;
}

.progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    color: white;
    padding: 24px 20px;
    text-align: center;
    position: relative;
}

.back-btn {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(255,255,255,0.25);
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.header p {
    opacity: 0.9;
    font-size: 14px;
    font-weight: 400;
}

/* Content Container */
.content {
    padding: 20px;
}

/* Step Cards */
.step-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.step-card:hover {
    border-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.15);
}

.step-card.completed {
    background: #eff6ff;
    border-color: #1d4ed8;
}

.step-card.active {
    border-color: #1d4ed8;
    background: #eff6ff;
}

.step-number {
    background: #1d4ed8;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 8px;
}

.step-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1e293b;
}

.step-description {
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.check-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    color: #1d4ed8;
    font-size: 16px;
    display: none;
}

.step-card.completed .check-icon {
    display: block;
}

/* Info Cards */
.info-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.info-card h6 {
    color: #1d4ed8;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 15px;
}

.data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.data-item:last-child {
    border-bottom: none;
}

.data-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 14px;
}

.data-value {
    font-weight: 500;
    color: #1f2937;
    word-break: break-word;
    text-align: right;
    max-width: 60%;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Instruction Box */
.instruction-box {
    background: #eff6ff;
    border-left: 3px solid #1d4ed8;
    padding: 16px;
    margin: 16px 0;
    border-radius: 8px;
}

.instruction-title {
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 8px;
    font-size: 14px;
}

.instruction-text {
    color: #374151;
    line-height: 1.6;
    font-size: 13px;
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
    font-family: inherit;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Generated Content Display */
.generated-content {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    display: none;
}

.generated-content.show {
    display: block;
}

.generated-item {
    margin-bottom: 12px;
    position: relative;
}

.generated-item:last-child {
    margin-bottom: 0;
}

.generated-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 6px;
}

.generated-value {
    font-size: 14px;
    color: #1e293b;
    font-weight: 500;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.generated-text {
    flex: 1;
    margin-right: 8px;
    word-break: break-word;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 100px;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn-group .btn {
    flex: 1;
    min-width: 120px;
}

.copy-btn {
    background: #1d4ed8;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: #1e40af;
    transform: scale(1.05);
}

.copy-btn.copied {
    background: #059669;
}

/* Alerts */
.alert {
    padding: 12px;
    border-radius: 8px;
    margin: 12px 0;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Verification Code Box */
.verification-code-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #059669;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.verification-code-box h4 {
    font-size: 16px;
    font-weight: 600;
    color: #065f46;
    margin-bottom: 12px;
}

.verification-code {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #059669;
    font-family: 'Courier New', monospace;
    margin: 12px 0;
    padding: 12px;
    background: white;
    border-radius: 8px;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    margin: 16px 0;
    text-align: center;
}

.spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #1d4ed8;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
    margin: 0 auto 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 13px;
    color: #6b7280;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
    margin: 10px 0;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-label:hover {
    background: #f1f5f9;
    border-color: #1d4ed8;
}

/* Image Preview */
.image-preview {
    text-align: center;
    margin: 16px 0;
}

.preview-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
}

/* Comment Generator */
.comment-generator {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.comment-generator h6 {
    color: #1e40af;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 15px;
}

.comment-picker {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.comment-option {
    background: white;
    border: 2px solid #dbeafe;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.comment-option:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.comment-text {
    margin: 0;
    color: #1e293b;
    font-size: 14px;
    padding-right: 70px;
}

.copy-comment-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.copy-comment-btn:hover {
    background: #1d4ed8;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .main-container {
        border-radius: 8px;
        margin: 0;
    }

    .content {
        padding: 16px;
    }

    .header {
        padding: 20px 16px;
    }

    .header h1 {
        font-size: 18px;
    }

    .header p {
        font-size: 13px;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
        margin-bottom: 8px;
    }

    .step-card {
        padding: 14px;
    }

    .form-input, .form-textarea {
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .progress-container {
        padding: 12px 16px;
    }

    .generated-value {
        flex-direction: column;
        align-items: stretch;
    }

    .generated-text {
        margin-right: 0;
        margin-bottom: 8px;
    }

    .copy-btn {
        align-self: center;
    }

    .data-value {
        max-width: 55%;
        flex-direction: column;
        align-items: flex-end;
    }

    .comment-text {
        padding-right: 0;
        margin-bottom: 8px;
    }

    .copy-comment-btn {
        position: static;
        transform: none;
        width: 100%;
        margin-top: 8px;
    }
}

@media (max-width: 360px) {
    .header h1 {
        font-size: 16px;
    }
    
    .step-title {
        font-size: 15px;
    }
    
    .step-description {
        font-size: 12px;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: #6b7280;
}

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }

.w-100 {
    width: 100%;
}
/* Comment display customization */
.comment-picker.no-copy-buttons .copy-comment-btn {
    display: none !important;
}

.comment-picker.single-comment .comment-option {
    border: 2px solid #1d4ed8;
    background: linear-gradient(135deg, #f0f8ff 0%, #e8f4f8 100%);
}

.comment-picker.single-comment .comment-option::before {
    content: "Your assigned comment:";
    display: block;
    font-weight: 600;
    color: #1d4ed8;
    margin-bottom: 8px;
    font-size: 12px;
    text-transform: uppercase;
}