* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #e5e7eb;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Hero Section */
.hero-section {
    background: white;
    border-radius: 12px;
    padding: 40px 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.hero-section h1 {
    font-size: 2.5em;
    color: #2d3748;
    margin-bottom: 15px;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: 1.2em;
    color: #4a5568;
    max-width: 900px;
    margin: 0 auto 15px auto;
    line-height: 1.5;
    font-weight: 500;
}

.hero-description {
    font-size: 1em;
    color: #718096;
    max-width: 800px;
    margin: 0 auto 20px auto;
    line-height: 1.6;
}

.official-link {
    margin-top: 20px;
    padding: 15px 20px;
    background: #fef3c7;
    border-radius: 8px;
    display: inline-block;
}

.official-link a {
    color: #d97706;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05em;
}

.official-link a:hover {
    text-decoration: underline;
    color: #b45309;
}

/* Content Sections */
.content-section {
    background: white;
    border-radius: 12px;
    padding: 35px 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.content-section h2 {
    font-size: 1.9em;
    color: #2d3748;
    margin-bottom: 25px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.content-section h3 {
    font-size: 1.4em;
    color: #4a5568;
    margin: 25px 0 15px 0;
}

.content-section p {
    color: #4a5568;
    margin-bottom: 18px;
    font-size: 1.05em;
    line-height: 1.8;
}

/* Main Tool Card */
.main-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-header {
    text-align: center;
    margin-bottom: 30px;
}

.card-header h2 {
    font-size: 2em;
    color: #2d3748;
    margin-bottom: 10px;
}

.card-header p {
    color: #718096;
    font-size: 1.1em;
}

/* How To Use Section */
.how-to-use ol {
    counter-reset: step-counter;
    list-style: none;
    padding-left: 0;
}

.how-to-use ol li {
    counter-increment: step-counter;
    margin-bottom: 25px;
    padding-left: 50px;
    position: relative;
    color: #4a5568;
    line-height: 1.8;
}

.how-to-use ol li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: #667eea;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1em;
}

.how-to-use ul {
    margin: 15px 0 15px 20px;
    list-style-type: disc;
}

.how-to-use ul li {
    margin-bottom: 8px;
    padding-left: 0;
}

.how-to-use ul li::before {
    display: none;
}

.tip {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 15px 20px;
    margin-top: 25px;
    border-radius: 5px;
    font-style: italic;
}

/* FAQ Section */
.faq-item {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e2e8f0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    color: #2d3748;
    font-size: 1.3em;
    margin-bottom: 12px;
}

.faq-item p {
    color: #4a5568;
    margin-bottom: 12px;
    line-height: 1.8;
}

.faq-item ul, .faq-item ol {
    margin: 12px 0 12px 25px;
    color: #4a5568;
}

.faq-item li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.faq-item a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.faq-item a:hover {
    text-decoration: underline;
}

/* Benefits Section */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.benefit-item {
    padding: 25px;
    background: #f7fafc;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.benefit-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.benefit-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.benefit-item h3 {
    font-size: 1.3em;
    color: #2d3748;
    margin: 0 0 12px 0;
}

.benefit-item p {
    color: #4a5568;
    font-size: 1em;
    line-height: 1.7;
    margin: 0;
}

/* Kerala PSC Specific Info */
.specifications {
    background: #f0f9ff;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.spec-item {
    padding: 10px 0;
    border-bottom: 1px solid #bfdbfe;
    color: #1e40af;
    font-size: 1.05em;
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-item strong {
    color: #1e3a8a;
}

.note {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 15px 20px;
    margin-top: 20px;
    border-radius: 5px;
}

/* Tips Section */
.tips-list {
    list-style-type: none;
    padding-left: 0;
}

.tips-list li {
    padding: 12px 15px 12px 45px;
    margin-bottom: 12px;
    background: #f7fafc;
    border-radius: 8px;
    position: relative;
    color: #4a5568;
    line-height: 1.7;
}

.tips-list li::before {
    content: "✓";
    position: absolute;
    left: 15px;
    color: #10b981;
    font-weight: bold;
    font-size: 1.3em;
}

/* Upload Section */
.upload-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 60px 40px;
    background: #f7fafc;
    border: 3px dashed #667eea;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-section:hover {
    background: #edf2f7;
    border-color: #5a67d8;
}

.upload-icon {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.upload-icon svg {
    transition: transform 0.3s ease;
}

.upload-section:hover .upload-icon svg {
    transform: translateY(-5px);
}

.file-name {
    margin-top: 15px;
    color: #4a5568;
    font-size: 14px;
}

.btn {
    padding: 12px 30px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #cbd5e0;
    color: #2d3748;
    margin-right: 10px;
}

.btn-secondary:hover {
    background: #a0aec0;
}

.btn-success {
    background: #10b981;
    color: white;
    width: 100%;
    padding: 15px;
    font-size: 18px;
    margin-top: 20px;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.file-name {
    margin-top: 15px;
    color: #4a5568;
    font-size: 14px;
}

/* Preview Section */
.preview-section {
    margin-bottom: 30px;
}

.preview-container {
    text-align: center;
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    border: 2px dashed #cbd5e0;
}

.preview-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 4px;
}

/* Controls Section */
.controls-section {
    margin-top: 30px;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 500;
}

.control-group select,
.control-group input[type="number"],
.control-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: #667eea;
}

.control-group input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.control-group input[type="range"] {
    width: calc(100% - 60px);
    margin-right: 10px;
}

#qualityValue {
    color: #667eea;
    font-weight: 600;
}

/* Dimension Inputs */
.dimension-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
}

/* Crop Container */
.crop-container {
    max-width: 100%;
    max-height: 500px;
    overflow: hidden;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 15px;
}

.crop-container img {
    max-width: 100%;
}

.crop-controls {
    text-align: center;
    margin-bottom: 20px;
}

/* Success Message */
#successMessage {
    margin-top: 20px;
    padding: 15px;
    background: #d1fae5;
    border: 2px solid #10b981;
    border-radius: 8px;
    color: #065f46;
    text-align: center;
}

/* Footer */
.footer {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-text {
    font-size: 1.1em;
    color: #4a5568;
    margin-bottom: 15px;
}

.footer-text a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.footer-text a:hover {
    text-decoration: underline;
}

.footer-tagline {
    font-size: 1em;
    color: #718096;
    margin-bottom: 10px;
}

.footer-tagline::after {
    content: "❤️";
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.footer-contact {
    margin-top: 15px;
}

.footer-contact a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05em;
}

.footer-contact a:hover {
    text-decoration: underline;
}

.footer-privacy {
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    margin-top: 20px;
}

.footer-privacy p {
    color: #718096;
    font-size: 0.95em;
}

/* Mode Buttons Styling */
.mode-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.mode-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #cbd5e0;
    background: white;
    color: #4a5568;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    border-color: #667eea;
    background: #f7fafc;
    transform: translateY(-1px);
}

.mode-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.mode-btn.active:hover {
    background: #5a67d8;
    border-color: #5a67d8;
}

/* Dimension Inputs - Side by Side */
.dimension-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

/* Manual Crop Controls */
.manual-crop-controls {
    margin-top: 15px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.crop-control-group {
    margin-bottom: 15px;
}

.crop-control-group:last-child {
    margin-bottom: 0;
}

.crop-control-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 600;
    font-size: 14px;
}

#zoomSlider {
    flex: 1;
    width: 100%;
}

#zoomValue {
    color: #667eea;
    font-weight: 600;
    min-width: 45px;
    display: inline-block;
}

.crop-btn {
    padding: 8px 12px;
    border: 2px solid #cbd5e0;
    background: white;
    color: #4a5568;
    border-radius: 6px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
}

.crop-btn:hover {
    border-color: #667eea;
    background: #f7fafc;
    color: #667eea;
}

.crop-btn:active {
    transform: scale(0.95);
}

/* Pan Controls Layout */
.pan-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.pan-horizontal {
    display: flex;
    gap: 5px;
}

.pan-controls .crop-btn {
    width: 45px;
    height: 45px;
}

/* Crop Aspect Warning Box */
#cropAspectWarning {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .mode-buttons {
        flex-direction: column;
    }
    
    .dimension-inputs {
        grid-template-columns: 1fr;
    }
    
    .manual-crop-controls {
        padding: 12px;
    }
    
    .crop-btn {
        padding: 10px;
        font-size: 16px;
    }
    
    .pan-controls .crop-btn {
        width: 50px;
        height: 50px;
    }
}


/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .hero-section h1 {
        font-size: 1.8em;
    }

    .hero-subtitle {
        font-size: 1.05em;
    }

    .hero-description {
        font-size: 0.95em;
    }

    .content-section, .main-card {
        padding: 20px;
    }

    .content-section h2 {
        font-size: 1.5em;
    }

    .dimension-inputs {
        grid-template-columns: 1fr;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .how-to-use ol li {
        padding-left: 45px;
    }

    .how-to-use ol li::before {
        width: 30px;
        height: 30px;
        font-size: 1em;
    }
}