/* DocStrange Design System CSS */

/* CSS Variables for DocStrange Design System */
:root {
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Colors - Primary Blue */
    --primary-darkest: #13152A;
    --primary-darker: #1D2554;
    --primary-dark: #3A4DB2;
    --primary-blue: #546FFF;
    --primary-light: #BBC5FF;
    --primary-lighter: #EAEDFF;
    --primary-lightest: #F2F4FF;
    --primary-bg: #F8FAFF;
    
    /* Colors - Neutrals */
    --black: #1F2129;
    --grey-dark: #404558;
    --grey-medium: #676767;
    --grey-light: #F8F9FA;
    --white: #FFFFFF;
    
    /* Colors - Accents */
    --green: #18855E;
    --green-light: #41A451;
    --orange: #ED6E33;
    --red: #D02B2B;
    --yellow: #995C00;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    --spacing-xxl: 32px;
    --spacing-xxxl: 48px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--primary-bg);
    color: var(--black);
    line-height: 1.6;
}

/* Typography Classes */
.title-48 {
    font-size: 48px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-md);
}

.title-36 {
    font-size: 36px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-md);
}

.title-24 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: var(--spacing-sm);
}

.title-20 {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: var(--spacing-sm);
}

.title-16 {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: var(--spacing-xs);
}

.body-big {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
}

.body-normal {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
}

.body-small {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: var(--spacing-xs);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xxl);
}

.header {
    text-align: center;
    margin-bottom: var(--spacing-xxxl);
}

.header .body-big {
    color: var(--grey-medium);
    max-width: 600px;
    margin: 0 auto;
}

.main-content {
    display: grid;
    gap: var(--spacing-xxl);
    margin-bottom: var(--spacing-xxxl);
}

/* Free Badge */
.free-badge {
    margin-bottom: var(--spacing-lg);
}

.badge-free {
    background: var(--green);
    color: var(--white);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cards */
.upload-card, .results-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xxl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--primary-lighter);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed var(--primary-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xxxl);
    text-align: center;
    background: var(--primary-lightest);
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: var(--spacing-xl);
}

.file-upload-area:hover {
    border-color: var(--primary-blue);
    background: var(--primary-lighter);
}

.file-upload-area.dragover {
    border-color: var(--primary-blue);
    background: var(--primary-lighter);
    transform: scale(1.02);
}

.upload-icon {
    margin-bottom: var(--spacing-lg);
}

.file-upload-area .body-big {
    color: var(--primary-dark);
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
}

.file-upload-area .body-normal {
    color: var(--grey-medium);
    margin-bottom: var(--spacing-lg);
}

/* File Info */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-lightest);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.file-name {
    font-weight: 500;
    color: var(--primary-dark);
}

.file-size {
    font-size: 12px;
    color: var(--grey-medium);
}

.btn-remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
}

.btn-remove:hover {
    background: var(--primary-lighter);
}

/* Form Sections */
.form-section {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-xl);
    background: var(--white);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-lg);
}

.form-section h3 {
    margin-bottom: var(--spacing-sm);
    color: var(--primary-darkest);
}

.form-section p {
    margin-bottom: var(--spacing-lg);
    color: var(--grey-medium);
}

/* Radio Groups */
.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.radio-option {
    display: flex;
    align-items: flex-start;
    padding: var(--spacing-md);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--white);
    flex-direction: column;
    gap: var(--spacing-xs);
}

.radio-option:hover {
    border-color: var(--primary-blue);
    background: var(--primary-lightest);
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--primary-light);
    border-radius: 50%;
    margin-right: var(--spacing-sm);
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary-blue);
    background: var(--primary-blue);
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: var(--white);
    border-radius: 50%;
}

.radio-label {
    font-weight: 500;
    color: var(--primary-darkest);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.radio-description {
    font-size: 12px;
    color: var(--grey-medium);
    margin-left: 26px;
    line-height: 1.4;
}

.radio-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--grey-light);
}

.radio-option.disabled:hover {
    border-color: var(--primary-light);
    background: var(--grey-light);
}

.radio-option.disabled .radio-label {
    cursor: not-allowed;
}

.radio-option.disabled input[type="radio"] {
    cursor: not-allowed;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

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

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-blue);
    border: 1px solid var(--primary-light);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary-lightest);
    border-color: var(--primary-blue);
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.results-meta {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.meta-item {
    background: var(--primary-lightest);
    color: var(--primary-dark);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
}

.results-content {
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Tabs */
.content-tabs {
    display: flex;
    border-bottom: 1px solid var(--primary-lighter);
    margin-bottom: var(--spacing-xl);
}

.tab-btn {
    background: none;
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    color: var(--grey-medium);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--primary-blue);
}

.tab-btn.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}

.tab-content {
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.tab-pane {
    display: none;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.tab-pane.active {
    display: block;
}

/* Content Display */
.preview-content {
    background: var(--grey-light);
    border: 1px solid var(--primary-lighter);
    border-radius: var(--radius-md);
    padding: var(--spacing-xl);
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    font-family: var(--font-family);
    line-height: 1.6;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    hyphens: auto;
    word-break: break-word;
}

.raw-content {
    background: var(--primary-darkest);
    color: var(--primary-light);
    padding: var(--spacing-xl);
    border-radius: var(--radius-md);
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Download Options */
.download-options {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

/* Supported Formats */
.supported-formats {
    text-align: center;
    margin-top: var(--spacing-xxxl);
}

.supported-formats .title-20 {
    margin-bottom: var(--spacing-xl);
    color: var(--primary-darkest);
}

.format-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: center;
}

.format-tag {
    background: var(--primary-lightest);
    color: var(--primary-dark);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--primary-light);
}

/* Warning Message */
.warning-message {
    background: #FFF3CD;
    border: 1px solid #FFEAA7;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.warning-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.warning-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.warning-text {
    font-size: 14px;
    color: #856404;
    line-height: 1.4;
}

/* Cloud Redirect */
.cloud-redirect {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--primary-lightest);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-md);
    text-align: center;
}

.cloud-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.cloud-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-lg);
    }
    
    .title-48 {
        font-size: 32px;
    }
    
    .upload-card, .results-card {
        padding: var(--spacing-xl);
    }
    
    .file-upload-area {
        padding: var(--spacing-xl);
    }
    
    .radio-group {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .content-tabs {
        flex-wrap: wrap;
    }
    
    .download-options {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: var(--spacing-md);
    }
    
    .title-48 {
        font-size: 28px;
    }
    
    .upload-card, .results-card {
        padding: var(--spacing-lg);
    }
    
    .file-upload-area {
        padding: var(--spacing-lg);
    }
    
    .format-tags {
        flex-direction: column;
        align-items: center;
    }
} 