/* Base Styles */
:root {
    --primary-color: #4285f4;
    --secondary-color: #34a853;
    --accent-color: #ea4335;
    --light-color: #f8f9fa;
    --dark-color: #202124;
    --gray-color: #5f6368;
    --light-gray: #e8eaed;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f5f5;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem 0;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Navigation */
nav {
    background-color: white;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav ul {
    display: flex;
    list-style: none;
}

nav li {
    flex: 1;
    text-align: center;
}

nav a {
    display: block;
    padding: 1rem;
    text-decoration: none;
    color: var(--gray-color);
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

nav a:hover, nav a.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

/* Main Content */
main {
    padding: 2rem 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.hero p {
    font-size: 1.1rem;
    color: var(--gray-color);
    max-width: 700px;
    margin: 0 auto 2rem;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

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

.btn.primary:hover {
    background-color: #3367d6;
    transform: translateY(-2px);
}

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

.btn.secondary:hover {
    background-color: #f0f7ff;
    transform: translateY(-2px);
}

.btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Grid Layouts */
.features-grid, .converter-grid, .tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card, .converter-card, .tool-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
}

.feature-card:hover, .converter-card:hover, .tool-card:hover {
    transform: translateY(-5px);
}

.feature-card i, .converter-card i, .tool-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3, .converter-card h3, .tool-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.feature-card p, .tool-card p {
    color: var(--gray-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 800px;
    width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-color);
}

.close:hover {
    color: var(--dark-color);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--light-gray);
    border-radius: var(--border-radius);
    padding: 3rem 1rem;
    text-align: center;
    margin: 1rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.upload-area i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-area p {
    margin-bottom: 1.5rem;
    color: var(--gray-color);
}

#fileInput {
    display: none;
}

/* Options Panel */
.options-panel {
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.options-panel h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--dark-color);
}

.option-group {
    margin-bottom: 1rem;
}

.option-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.option-group select, .option-group input[type="number"], .option-group input[type="color"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    font-family: inherit;
}

.margin-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.margin-inputs input {
    text-align: center;
}

.border-options {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.border-options input[type="color"] {
    flex: 1;
    padding: 0;
    height: 38px;
}

.border-options input[type="number"] {
    flex: 2;
}

/* File Preview */
.file-preview {
    margin-top: 1.5rem;
}

.file-preview h3 {
    margin-bottom: 1rem;
}

#fileList {
    list-style: none;
    margin-bottom: 1.5rem;
}

#fileList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid var(--light-gray);
}

#fileList li:last-child {
    border-bottom: none;
}

/* Progress Modal */
.progress-container {
    margin: 2rem 0;
    background-color: var(--light-gray);
    border-radius: 20px;
    height: 20px;
    position: relative;
}

.progress-bar {
    background-color: var(--primary-color);
    border-radius: 20px;
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

#progressText {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

#statusMessage {
    text-align: center;
    color: var(--gray-color);
}

/* Download Modal */
.download-area {
    text-align: center;
    padding: 2rem 0;
}

.success-icon {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

/* About Page */
.about-content {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.about-content h3 {
    margin: 1.5rem 0 1rem;
    color: var(--primary-color);
}

.about-content ul, .about-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.about-content li {
    margin-bottom: 0.5rem;
}

.disclaimer {
    background-color: #fff8e1;
    padding: 1rem;
    border-left: 4px solid #ffc107;
    margin-top: 1.5rem;
}

.disclaimer p {
    color: #5d4037;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: white;
    margin: 0 1rem;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .margin-inputs {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }

    .features-grid, .converter-grid, .tools-grid {
        grid-template-columns: 1fr;
    }

    .margin-inputs {
        grid-template-columns: 1fr;
    }
}

/* Make entire converter card tappable via <a> */
.converter-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
}

/* Ensure card inside the link behaves normally */
.converter-card-link .converter-card {
    cursor: pointer;
    transition: transform 0.2s ease;
}

/* Optional: Add hover effect */
.converter-card-link .converter-card:hover {
    transform: scale(1.02);
}