/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

/* Container Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
    margin-bottom: 20px;
}

/* Usage Statistics */
.stats-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-item {
    text-align: center;
    padding: 10px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-number {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #2980b9;
    margin-bottom: 5px;
}

.stat-label {
    display: block;
    color: #7f8c8d;
    font-size: 0.9em;
    font-weight: 500;
}

/* Connection Status */
.connection-status {
    min-width: 100px;
}

.connection-indicator {
    display: block;
    font-size: 1.2em;
    margin-bottom: 5px;
    animation: pulse 2s infinite;
}

.connection-indicator.online {
    color: #27ae60;
}

.connection-indicator.offline {
    color: #e74c3c;
}

#connectionLabel {
    font-size: 0.8em;
    color: #95a5a6;
}

/* Form Container */
.form-container {
    padding: 30px;
}

/* Section Styles */
.section {
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    border: 1px solid rgba(52, 152, 219, 0.1);
    transition: all 0.3s ease;
}

.section:hover {
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #3498db;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    background: rgba(52, 152, 219, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: #2980b9;
}

.upload-text i {
    font-size: 3em;
    display: block;
    margin-bottom: 15px;
}

.upload-text p {
    font-size: 1.2em;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.upload-text small {
    color: #7f8c8d;
    font-size: 0.9em;
}

.hidden-input {
    display: none;
}

.image-preview {
    margin-top: 20px;
    text-align: center;
}

/* Input Styles */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 15px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

/* Custom Days Group */
.custom-days-hidden {
    display: none;
}

.custom-days-visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* A4 Preview */
.a4-preview {
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.a4-content {
    position: relative;
    aspect-ratio: 210/297;
    max-width: 400px;
    margin: 0 auto;
    background: white;
    border: 1px solid #ccc;
    padding: 20px;
    font-size: 0.8em;
    overflow: hidden;
}

.mock-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.mock-logo {
    font-size: 2em;
    margin-bottom: 10px;
}

.mock-title p {
    margin: 2px 0;
    font-size: 0.9em;
    color: #333;
}

.mock-body {
    margin-bottom: 20px;
}

.mock-body h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.mock-body p {
    margin: 5px 0;
    color: #555;
    font-size: 0.8em;
}

.watermark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-watermark {
    transform: rotate(-45deg);
    font-size: 1.2em;
    font-weight: bold;
    color: rgba(231, 76, 60, 0.5);
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.mock-bottom {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
}

.bottom-text-preview p {
    margin: 2px 0;
    font-size: 0.7em;
    color: rgb(139, 0, 0);
}

/* Generate Button */
.generate-btn {
    width: 100%;
    padding: 20px;
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.generate-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, #229954, #27ae60);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.6);
}

.generate-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    font-size: 1.3em;
}

.loading {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Canvas */
.pdf-canvas {
    display: none;
}

/* WebView Warning Styles */
.webview-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.warning-content {
    background: white;
    border-radius: 15px;
    padding: 25px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.warning-content h3 {
    color: #e67e22;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.warning-content p {
    color: #2c3e50;
    margin-bottom: 15px;
    line-height: 1.5;
}

.warning-content ul {
    text-align: left;
    margin: 15px 0;
    padding-left: 20px;
}

.warning-content li {
    color: #7f8c8d;
    margin-bottom: 8px;
}

.close-warning {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.close-warning:hover {
    background: linear-gradient(45deg, #2980b9, #1f4e79);
    transform: translateY(-2px);
}

/* Developer Footer */
.developer-footer {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 30px;
    text-align: center;
    margin-top: 30px;
}

.developer-info-main p {
    margin: 8px 0;
    font-size: 0.9em;
}

.developer-info-main a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.developer-info-main a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Web Counter Styles */
.web-counter {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: inline-block;
    transition: all 0.3s ease;
}

.web-counter:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.counter-image {
    display: block;
    margin: 0 auto 8px auto;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.counter-image:hover {
    transform: scale(1.05);
}

.counter-label {
    display: block;
    color: #bdc3c7;
    font-size: 0.8em;
    margin-top: 5px;
    font-weight: 500;
}

/* Floating Support Bot */
.support-bot {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.support-bot:hover {
    transform: translateY(-5px);
}

.bot-icon {
    position: relative;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    animation: bounce 2s infinite;
}

.bot-icon:hover {
    background: linear-gradient(135deg, #ff5252, #ff6b6b);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.bot-emoji {
    font-size: 1.8em;
    animation: wave 1s ease-in-out infinite alternate;
}

.bot-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 107, 107, 0.3);
    animation: pulse 1.5s infinite;
}

.bot-tooltip {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9em;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.support-bot:hover .bot-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tooltip-arrow {
    position: absolute;
    top: 100%;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 0, 0, 0.8);
}

/* Bot Animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes wave {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(15deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    header {
        padding: 30px 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .stats-container {
        gap: 15px;
        padding: 10px;
    }
    
    .stat-item {
        padding: 8px 15px;
    }
    
    .stat-number {
        font-size: 1.5em;
    }
    
    .stat-label {
        font-size: 0.8em;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .section {
        padding: 20px;
    }
    
    .upload-area {
        padding: 30px 20px;
    }
    
    .a4-content {
        max-width: 300px;
    }
    
    .preview-watermark {
        font-size: 1em;
    }
    
    .bottom-text-preview p {
        font-size: 0.6em;
    }
    
    /* Support bot responsive */
    .support-bot {
        bottom: 20px;
        right: 20px;
    }
    
    .bot-icon {
        width: 50px;
        height: 50px;
    }
    
    .bot-emoji {
        font-size: 1.5em;
    }
    
    .bot-tooltip {
        bottom: 60px;
        right: 0;
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .stats-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-container {
        padding: 15px;
    }
    
    .section {
        padding: 15px;
    }
    
    .upload-area {
        padding: 20px 15px;
    }
    
    .upload-text p {
        font-size: 1.1em;
    }
    
    .a4-content {
        max-width: 280px;
    }
    
    .generate-btn {
        padding: 15px;
        font-size: 1.1em;
    }
    
    /* Support bot mobile */
    .support-bot {
        bottom: 15px;
        right: 15px;
    }
    
    .bot-icon {
        width: 45px;
        height: 45px;
    }
    
    .bot-emoji {
        font-size: 1.3em;
    }
    
    .bot-tooltip {
        bottom: 55px;
        font-size: 0.75em;
        padding: 6px 10px;
    }
    
    /* Web counter mobile */
    .web-counter {
        margin-top: 15px;
        padding: 10px;
    }
    
    .counter-image {
        max-width: 120px;
        height: auto;
    }
    
    .counter-label {
        font-size: 0.75em;
    }
}
