/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header .subtitle {
    font-size: 1.1rem;
}

nav {
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    padding: 0;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    display: block;
    padding: 15px 25px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

nav ul li a:hover {
    background: white;
    border-bottom-color: #667eea;
    color: #667eea;
}

main {
    padding: 40px;
}

section {
    margin-bottom: 40px;
}

section h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.hero {
    background: #f0f4ff;
    padding: 30px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.hero p {
    font-size: 1.1rem;
    color: #555;
}

.hero code {
    background: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #d63384;
}

.features ul {
    list-style: none;
    padding-left: 0;
}

.features ul li {
    padding: 10px 0;
    font-size: 1.05rem;
    border-bottom: 1px solid #e9ecef;
}

.features ul li:last-child {
    border-bottom: none;
}

.features ul li a {
    color: #667eea;
    text-decoration: none;
}

.features ul li a:hover {
    text-decoration: underline;
}

.api-demo {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    border: 2px dashed #667eea;
}

.api-demo code {
    background: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #d63384;
    display: block;
    margin: 10px 0;
}

.api-demo button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 15px;
    transition: background 0.3s ease;
}

.api-demo button:hover {
    background: #764ba2;
}

#weather-result {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 5px;
    border-left: 4px solid #667eea;
    min-height: 20px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    display: none;
}

#weather-result.show {
    display: block;
}

footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 20px;
    text-align: center;
    color: #666;
    padding: 40px 20px;
}

/* Resume-specific styles */
.skills-section {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.skills-section h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-badge {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    display: inline-block;
    transition: all 0.3s ease;
}

.skill-badge:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

.interests-section {
    margin-top: 25px;
}

.interests-section h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.interests-section p {
    font-size: 1.1rem;
    margin: 10px 0;
    padding-left: 15px;
}

.social-links {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.social-links h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.social-icons {
    display: flex;
    gap: 20px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: #764ba2;
    transform: scale(1.1);
}

/* Contact Section */
.contact-section {
    margin-top: 40px;
}

.contact-header {
    text-align: center;
    padding-bottom: 25px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
}

.contact-header h2 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 8px;
}

.contact-header h2 i {
    margin-right: 8px;
    opacity: 0.85;
}

.contact-header p {
    color: #666;
    font-size: 1rem;
}

.message-widget {
    background: white;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(102, 126, 234, 0.12);
    border: 1px solid #e8ecff;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.field-required {
    color: #667eea;
    font-weight: 700;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.form-group textarea,
.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group textarea:focus,
.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.verification-section {
    background: #f8f9ff;
    border: 1px solid #dde3ff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.verification-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #667eea;
    letter-spacing: 0.08em;
    margin-bottom: 15px;
}

.verification-title i {
    margin-right: 6px;
}

.captcha-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.captcha-container altcha-widget {
    --altcha-color-base: #ffffff;
    --altcha-color-border: #e0e6ff;
    --altcha-color-border-focus: #667eea;
    --altcha-color-text: #333333;
    --altcha-border-radius: 8px;
    --altcha-max-width: 100%;
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.captcha-image-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

#captcha-img {
    width: 180px;
    height: 50px;
    border: 1px solid #e0e6ff;
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: block;
    flex-shrink: 0;
}

#captcha-text {
    font-family: 'Courier New', ui-monospace, monospace;
    font-size: 1.05rem;
    letter-spacing: 0.15em;
}

#captcha-text::placeholder {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.95rem;
    color: #999;
}

.refresh-captcha-btn {
    width: 50px;
    height: 50px;
    background: white;
    border: 1px solid #e0e6ff;
    color: #667eea;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.refresh-captcha-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.refresh-captcha-btn .icon {
    transition: transform 0.5s ease;
}

.refresh-captcha-btn:hover .icon {
    transform: rotate(180deg);
}

.submit-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

.submit-btn:hover:not(:disabled) {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#message-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    display: none;
}

#message-status.status-success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#message-status.status-error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Inline SVG icons */
.icon {
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: -0.125em;
    flex-shrink: 0;
}

.social-icon .icon {
    width: 1.5em;
    height: 1.5em;
}

/* CSS-only loading spinner */
.spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-rotate 0.6s linear infinite;
    vertical-align: -0.2em;
}

@keyframes spinner-rotate {
    to { transform: rotate(360deg); }
}

/* Inline address tag in hero */
.inline-address {
    display: inline;
    font-style: normal;
}

/* Categorized skills */
.skills-categories {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.skill-category h4 {
    color: #555;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

/* Projects */
.projects-section {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.projects-section h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.project-card {
    display: block;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.15);
    border-color: #c9d2ff;
}

.project-card h4 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.project-card p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Education + Languages */
.education-languages {
    margin-top: 25px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.education-block h3,
.languages-block h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.language-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    nav ul {
        flex-direction: column;
    }

    nav ul li a {
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    nav ul li a:hover {
        border-left-color: #667eea;
    }

    main {
        padding: 20px;
    }

    section {
        margin-bottom: 25px;
    }

    .skills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-snap-type: x proximity;
        padding-right: 8px;
        -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%);
        mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%);
    }

    .skills::-webkit-scrollbar {
        display: none;
    }

    .skill-category .skill-badge {
        flex: 0 0 auto;
        white-space: nowrap;
        scroll-snap-align: start;
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .social-icons {
        justify-content: center;
    }

    .message-widget {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .education-languages {
        grid-template-columns: 1fr;
    }

    .contact-header h2 {
        font-size: 1.6rem;
    }
}
