/* ==========================================================================
   PDF Tools - Main Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
    --primary: #e74c3c;
    --primary-dark: #c0392b;
    --success: #27ae60;
    --warning: #f39c12;
    --error: #e74c3c;
    --text: #333;
    --text-light: #666;
    --bg: #f8f9fa;
    --white: #fff;
    --border: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: var(--text);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

/* --------------------------------------------------------------------------
   Tool Page Layout
   -------------------------------------------------------------------------- */
.tool-page {
    padding: 40px 0;
}

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

.tool-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--text);
}

.tool-header .subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Tool Card
   -------------------------------------------------------------------------- */
.tool-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
}

.tool-card h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg);
}

.tool-card h3 {
    font-size: 1.1rem;
    margin: 20px 0 10px;
}

.notice-card {
    background: #fff9e6;
    border-left: 4px solid var(--warning);
}

/* --------------------------------------------------------------------------
   Upload Zone
   -------------------------------------------------------------------------- */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 20px;
    position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: #fef5f4;
}

.upload-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-text .icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.upload-text p {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 5px;
}

.upload-text small {
    color: var(--text-light);
}

.preview-area {
    margin-top: 20px;
}

.file-item {
    background: var(--bg);
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-num {
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.file-size {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Form Elements
   -------------------------------------------------------------------------- */
.form-section {
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group small {
    display: block;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 5px;
}

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

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-control,
.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

input[type="color"] {
    height: 45px;
    padding: 5px;
}

/* Radio & Checkbox Groups */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--bg);
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.radio-label:hover,
.checkbox-label:hover {
    background: #eee;
}

.radio-label input,
.checkbox-label input {
    width: 18px;
    height: 18px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

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

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

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

.btn-success:hover {
    background: #219a52;
    color: white;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* --------------------------------------------------------------------------
   Result Box
   -------------------------------------------------------------------------- */
.result-box {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.result-header {
    margin-bottom: 20px;
}

.result-header .icon {
    font-size: 3rem;
    color: var(--success);
    margin-bottom: 10px;
}

.result-header h3 {
    font-size: 1.5rem;
    color: #155724;
}

.result-message {
    color: #155724;
    margin-bottom: 20px;
}

.result-note {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 25px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #155724;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.stat-item.highlight .stat-value {
    color: var(--primary);
}

/* --------------------------------------------------------------------------
   How-To Steps
   -------------------------------------------------------------------------- */
.how-to-steps {
    counter-reset: step;
    list-style: none;
}

.how-to-steps li {
    position: relative;
    padding-left: 50px;
    margin-bottom: 15px;
    counter-increment: step;
}

.how-to-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Content Sections
   -------------------------------------------------------------------------- */
.content-section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
}

.content-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text);
}

.content-section h3 {
    font-size: 1.2rem;
    margin: 25px 0 15px;
}

.content-section p {
    margin-bottom: 15px;
    color: var(--text-light);
}

.content-section ul,
.content-section ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.content-section li {
    margin-bottom: 8px;
    color: var(--text-light);
}

.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    list-style: none;
    margin-left: 0;
}

.features-list li {
    padding: 12px 15px;
    background: var(--bg);
    border-radius: 5px;
    border-left: 3px solid var(--primary);
}

/* --------------------------------------------------------------------------
   FAQ Section
   -------------------------------------------------------------------------- */
.faq-section {
    background: var(--white);
}

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary);
}

.faq-item.active .faq-question::after {
    content: '−';
}

.faq-answer {
    color: var(--text-light);
    line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Tools Grid
   -------------------------------------------------------------------------- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tool-grid-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-decoration: none;
}

.tool-grid-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.tool-grid-item .tool-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.tool-grid-item h3 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 8px;
}

.tool-grid-item p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Related Tools
   -------------------------------------------------------------------------- */
.related-tools {
    background: var(--bg);
    padding: 50px 0;
}

.related-tools h2 {
    text-align: center;
    margin-bottom: 30px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    background: #2c3e50;
    color: white;
    padding: 50px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: white;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #bdc3c7;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #34495e;
    color: #95a5a6;
    font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Compression Info
   -------------------------------------------------------------------------- */
.compression-info {
    margin-top: 15px;
    background: var(--bg);
    padding: 15px;
    border-radius: 5px;
}

.compression-info p {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.compression-info p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tool-header h1 {
        font-size: 1.8rem;
    }
    
    .result-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .upload-zone {
        padding: 25px;
    }
}
