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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* Navigation Bar */
nav {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-links a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
}

/* Main Content */
main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.content-wrapper {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

h1 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
    text-align: center;
}

h2 {
    color: #764ba2;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

h3 {
    color: #667eea;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

p {
    margin-bottom: 1rem;
    text-align: justify;
}

/* Tool Card */
.tool-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.upload-section {
    text-align: center;
    margin-bottom: 2rem;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

input[type="file"] {
    display: none;
}

.file-label {
    display: inline-block;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.file-label:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Quality Control */
.quality-control {
    margin: 1.5rem 0;
    padding: 1rem;
    background: white;
    border-radius: 10px;
}

.quality-control label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #667eea;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #d3d3d3;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
}

.quality-value {
    display: inline-block;
    margin-left: 1rem;
    font-weight: bold;
    color: #764ba2;
}

/* Dimension Inputs */
.dimension-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: white;
    border-radius: 10px;
}

.dimension-inputs label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #667eea;
}

.dimension-inputs input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #667eea;
    border-radius: 5px;
    font-size: 1rem;
}

/* Preview Section */
.preview-section {
    margin: 2rem 0;
    text-align: center;
}

.preview-container {
    display: inline-block;
    max-width: 100%;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
}

#preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    display: none;
}

#preview.show {
    display: block;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

button {
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(17, 153, 142, 0.4);
}

/* Result Section */
.result-section {
    margin-top: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    display: none;
}

.result-section.show {
    display: block;
}

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

.info-item {
    padding: 1rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    text-align: center;
}

.info-item strong {
    display: block;
    color: #667eea;
    margin-bottom: 0.5rem;
}

/* FAQ Section */
.faq-section {
    margin-top: 3rem;
}

.faq-item {
    background: white;
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.faq-question {
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    transition: all 0.3s ease;
}

.faq-question:hover {
    opacity: 0.9;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.faq-question.active::after {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 1.5rem;
}

.faq-answer.show {
    max-height: 500px;
    padding: 1.5rem;
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

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

.footer-section h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
}

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

.footer-links a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 0.3rem 0;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #667eea;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
        width: 100%;
    }
    
    nav .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .dimension-inputs {
        grid-template-columns: 1fr;
    }
    
    .result-info {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
.loading {
    display: none;
    text-align: center;
    margin: 1rem 0;
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    background: #ff4444;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: none;
}

.error-message.show {
    display: block;
}

/* Success Message */
.success-message {
    background: #00C851;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: none;
}

.success-message.show {
    display: block;
}
