/* CSS Variables - PDF Modifier Theme */
:root {
    --primary: #2471a3;
    --primary-dark: #1a5276;
    --secondary: #00d4ff;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --dark: #1a2332;
    --light: #f0f4f8;
    --white: #ffffff;
    --gray: #6c7a89;
    --gray-light: #bdc3c7;
    --gray-dark: #4a5568;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-lg: 0 5px 30px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

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

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    z-index: 1001;
}

.logo img {
    height: 40px;
    width: auto;
}

.logo svg {
    width: 40px;
    height: 40px;
}

/* Mobile Menu Toggle - Hidden on Desktop */
.menu-toggle {
    display: none !important;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--dark);
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.nav-menu {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-menu a {
    font-weight: 500;
    color: var(--dark);
    transition: var(--transition);
    padding: 10px 0;
    position: relative;
}

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

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-menu a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 80px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
    flex: 1;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 28px;
    color: var(--dark);
    margin-bottom: 10px;
}

.section-header p {
    color: var(--gray);
    font-size: 16px;
}

/* Tools Grid */
.tools-section {
    margin-bottom: 60px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.tool-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tool-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--white);
}

.tool-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.tool-card p {
    font-size: 12px;
    color: var(--gray);
}

/* Icon Colors */
.icon-red { background: #e74c3c; }
.icon-blue { background: #2471a3; }
.icon-green { background: #2ecc71; }
.icon-orange { background: #f39c12; }
.icon-purple { background: #9b59b6; }
.icon-teal { background: #00d4ff; }
.icon-pink { background: #e91e63; }
.icon-indigo { background: #3f51b5; }
.icon-gray { background: #95a5a6; }

/* Tool Page */
.tool-page {
    max-width: 800px;
    margin: 0 auto;
}

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

.tool-header h1 {
    font-size: 32px;
    color: var(--dark);
    margin-bottom: 10px;
}

.tool-header p {
    color: var(--gray);
    font-size: 16px;
}

/* Upload Area */
.upload-area {
    background: var(--white);
    border: 3px dashed var(--gray-light);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 30px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: #fef5f5;
}

.upload-area .upload-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 10px;
}

.upload-area p {
    color: var(--gray);
    font-size: 14px;
}

.upload-area .browse-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area .browse-btn:hover {
    background: var(--primary-dark);
}

/* Paste hint */
.paste-hint {
    margin-top: 15px;
    padding: 10px 15px;
    background: #f0f7ff;
    border-radius: var(--radius);
    color: var(--secondary);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* File List */
.file-list {
    margin: 20px 0;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}

.file-item .file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

.file-item .file-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--white);
    flex-shrink: 0;
}

.file-item .file-name {
    font-weight: 500;
    color: var(--dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item .file-size {
    font-size: 12px;
    color: var(--gray);
}

.file-item .remove-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: var(--transition);
    flex-shrink: 0;
}

.file-item .remove-btn:hover {
    transform: scale(1.2);
}

/* Options */
.options-area {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.options-area h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 20px;
}

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

.option-group:last-child {
    margin-bottom: 0;
}

.option-group label {
    display: block;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 8px;
}

.option-group select,
.option-group input[type="text"],
.option-group input[type="number"],
.option-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
}

.option-group select:focus,
.option-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Checkbox styling */
.option-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 30px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
    justify-content: center;
}

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

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

.btn-primary:disabled {
    background: var(--gray-light);
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
}

.btn-secondary:hover {
    background: var(--gray-light);
}

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

.btn-success:hover {
    background: #27ae60;
}

/* Progress Bar */
.progress-container {
    display: none;
    margin: 30px 0;
}

.progress-bar {
    height: 8px;
    background: var(--light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    color: var(--gray);
    font-size: 14px;
}

/* Result Area */
.result-area {
    display: none;
    text-align: center;
    padding: 40px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.result-area .success-icon {
    font-size: 64px;
    color: var(--success);
    margin-bottom: 20px;
}

.result-area h3 {
    font-size: 24px;
    color: var(--dark);
    margin-bottom: 10px;
}

.result-area p {
    color: var(--gray);
    margin-bottom: 20px;
}

/* Footer */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 60px 20px 30px;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 40px;
}

.footer-section h4 {
    font-size: 16px;
    margin-bottom: 20px;
    color: var(--white);
}

.footer-section ul {
    list-style: none;
}

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

.footer-section a {
    color: var(--gray-light);
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary);
}

.footer-bottom {
    max-width: 1400px;
    margin: 40px auto 0;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--gray);
    font-size: 14px;
}

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

/* Tablet */
@media (max-width: 992px) {
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Header Mobile */
    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 15px 20px;
        position: relative;
    }
    
    .menu-toggle {
        display: block !important;
    }
    
    .nav-menu {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        gap: 0;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        z-index: 999;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        border-bottom: 1px solid var(--light);
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a {
        display: block;
        padding: 15px 10px;
        font-size: 16px;
    }
    
    .nav-menu a::after {
        display: none;
    }
    
    /* Hero Mobile */
    .hero {
        padding: 50px 20px;
    }
    
    .hero h1 {
        font-size: 26px;
        line-height: 1.3;
    }
    
    .hero p {
        font-size: 14px;
    }
    
    /* Tools Grid Mobile */
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .tool-card {
        padding: 20px 12px;
    }
    
    .tool-card .icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .tool-card h3 {
        font-size: 12px;
    }
    
    .tool-card p {
        font-size: 11px;
    }
    
    /* Tool Page Mobile */
    .tool-page {
        max-width: 100%;
    }
    
    .tool-header h1 {
        font-size: 24px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .upload-area .upload-icon {
        font-size: 36px;
    }
    
    .upload-area h3 {
        font-size: 16px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    /* Footer Mobile */
    .footer {
        padding: 40px 20px 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-section h4 {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .footer-section a {
        font-size: 14px;
    }
    
    /* Options Mobile */
    .options-area {
        padding: 20px;
    }
    
    /* Result Mobile */
    .result-area {
        padding: 30px 20px;
    }
    
    .result-area .success-icon {
        font-size: 48px;
    }
    
    .result-area h3 {
        font-size: 20px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .logo {
        font-size: 20px;
    }
    
    .logo svg {
        width: 32px;
        height: 32px;
    }
    
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .tool-card {
        padding: 15px 10px;
    }
    
    .tool-card .icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .tool-card h3 {
        font-size: 11px;
    }
    
    .tool-card p {
        font-size: 10px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tool-card {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

.tool-card:nth-child(1) { animation-delay: 0.05s; }
.tool-card:nth-child(2) { animation-delay: 0.1s; }
.tool-card:nth-child(3) { animation-delay: 0.15s; }
.tool-card:nth-child(4) { animation-delay: 0.2s; }
.tool-card:nth-child(5) { animation-delay: 0.25s; }
.tool-card:nth-child(6) { animation-delay: 0.3s; }

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background: var(--dark);
    color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    animation: slideIn 0.3s ease;
    max-width: calc(100% - 60px);
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--secondary); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Print styles */
@media print {
    .header, .footer, .menu-toggle {
        display: none !important;
    }
    
    .container {
        padding: 0;
    }
}

/* PDF Editor Tool Card Special Styling */
.tool-card[style*="border: 2px solid"] .icon {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0,212,255,0.4); }
    50% { box-shadow: 0 0 20px 5px rgba(0,212,255,0.2); }
}

/* Editor-specific scrollbar styling */
.pages-panel::-webkit-scrollbar,
.properties-panel::-webkit-scrollbar,
.canvas-area::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.pages-panel::-webkit-scrollbar-track,
.properties-panel::-webkit-scrollbar-track,
.canvas-area::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

.pages-panel::-webkit-scrollbar-thumb,
.properties-panel::-webkit-scrollbar-thumb,
.canvas-area::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

.pages-panel::-webkit-scrollbar-thumb:hover,
.properties-panel::-webkit-scrollbar-thumb:hover,
.canvas-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

/* Editor button hover effects */
.editor-actions .btn {
    position: relative;
    overflow: hidden;
}

.editor-actions .btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.editor-actions .btn:hover::after {
    width: 200px;
    height: 200px;
}

/* Annotation layer transitions */
.annotation-box {
    transition: transform 0.1s ease;
}

.annotation-box:hover {
    transform: scale(1.02);
}

/* Tool button grid responsive */
@media (max-width: 1100px) {
    .tool-btn-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .tool-btn-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .canvas-toolbar {
        flex-wrap: wrap;
        max-width: 90%;
    }
}
