* {
    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-color: #f8f9fa;
}

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

/* Navigation */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 60px;
}

.nav-brand h2 {
    color:#2E6F40;
    font-weight: 700;
}

.nav-brand a {
    text-decoration: none;
    color: inherit;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #28a745;
}

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

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

.hero-title {
    font-size: 3.25rem;
    font-weight: 800;
    color: #2E6F40;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Input Section */
.input-section {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

.input-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.url-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.url-input:focus {
    outline: none;
    border-color: #007bff;
}

.input-note {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Result Section */
.result-section {
    margin: 2rem 0;
}

.result-container {
    background: #fff;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.empty-state, .loading-state, .error-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i, .loading-state i, .error-state i {
    color: #28a745;
    margin-bottom: 1rem;
}

.error-state i {
    color: #dc3545;
}

.empty-state h3, .loading-state p, .error-state p {
    color: #333;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #666;
}

/* Images Grid */
.images-grid {
    background: #fff;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.grid-header h3 {
    color: #2E6F40;
    font-size: 1.5rem;
}

.images-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.image-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.3s ease;
    border: 2px solid transparent;
}

.image-item:hover {
    transform: translateY(-4px);
    border-color: #007bff;
}

.image-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

.image-info {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.image-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 3rem 0 0;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #28a745, #007bff, #28a745);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

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

.footer-section h3 {
    color: #28a745;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section h4 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid #28a745;
    padding-bottom: 0.5rem;
}

.footer-section p {
    color: #bdc3c7;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-list {
    list-style: none;
    padding: 0;
}

.footer-list li {
    margin-bottom: 0.5rem;
}

.footer-list a {
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
}

.footer-list a:hover {
    color: #28a745;
    padding-left: 0.5rem;
}

.footer-list a i {
    width: 16px;
    text-align: center;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.social-links a:hover {
    background: #28a745;
    border-color: #28a745;
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    background: rgba(0, 0, 0, 0.2);
}

.footer-bottom-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0 1rem;
}

.footer-text {
    color: #bdc3c7;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(40, 167, 69, 0.3);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Guide Styles */
.guide-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.guide-header {
    text-align: center;
    padding: 2rem 0;
}

.guide-header h1 {
    font-size: 2.5rem;
    color: #28a745;
    margin-bottom: 1rem;
}

.guide-intro {
    font-size: 1.1rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
}

.guide-section {
    background: #fff;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.section-title {
    color: #28a745;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #28a745;
    padding-bottom: 0.5rem;
}

.content-box {
    line-height: 1.8;
}

.content-box p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

.highlight-green {
    background: linear-gradient(120deg, #28a745 0%, #28a745 100%);
    background-repeat: no-repeat;
    background-size: 100% 0.3em;
    background-position: 0 88%;
    color: #155724;
    font-weight: 600;
    padding: 0 0.2em;
}

.highlight-yellow {
    background: linear-gradient(120deg, #ffc107 0%, #ffc107 100%);
    background-repeat: no-repeat;
    background-size: 100% 0.3em;
    background-position: 0 88%;
    color: #856404;
    font-weight: 600;
    padding: 0 0.2em;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
    border-radius: 8px;
    background: #f8f9fa;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5rem;
    color: #28a745;
    margin-bottom: 1rem;
}

.feature-item h3 {
    color: #333;
    margin-bottom: 1rem;
}

.feature-item p {
    color: #666;
    line-height: 1.6;
}

/* Use Cases */
.use-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.use-case {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.use-case h3 {
    color: #28a745;
    margin-bottom: 0.5rem;
}

.use-case h3 i {
    margin-right: 0.5rem;
}

.use-case p {
    color: #666;
    line-height: 1.6;
}

/* Privacy Box */
.privacy-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.privacy-feature {
    text-align: center;
    padding: 1.5rem;
    background: #e8f5e8;
    border-radius: 8px;
}

.privacy-feature i {
    font-size: 2rem;
    color: #28a745;
    margin-bottom: 1rem;
}

.privacy-feature h3 {
    color: #155724;
    margin-bottom: 0.5rem;
}

.privacy-feature p {
    color: #155724;
    line-height: 1.6;
}

/* Responsive Design */
/* Tablet and small desktop */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Mobile and tablet */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    /* Navigation */
    .nav-container {
        padding: 1rem;
    }

    .nav-brand h2 {
        font-size: 1.4rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.9rem;
    }

    /* Hero Section */
    .hero {
        padding: 2rem 0;
    }

    .hero-title {
        font-size: 3rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    /* Input Section */
    .input-section {
        padding: 1.5rem 1rem;
        margin: 1.5rem 0;
    }

    .input-group {
        flex-direction: column;
        gap: 1rem;
    }

    .url-input {
        width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    /* Action Buttons */
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin: 1.5rem 0;
    }

    .action-buttons .btn {
        width: 100%;
    }

    /* Result Section */
    .result-container {
        padding: 1.5rem 1rem;
    }

    .images-grid {
        padding: 1.5rem 1rem;
    }

    .grid-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .grid-header h3 {
        font-size: 1.2rem;
    }

    .images-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.8rem;
    }

    .image-item {
        padding: 0.8rem;
    }

    .image-preview {
        height: 120px;
    }

    .image-actions {
        flex-direction: column;
        gap: 0.3rem;
    }

    .btn-sm {
        padding: 0.5rem;
        font-size: 0.75rem;
        width: 100%;
    }

    /* Footer */
    .footer {
        padding: 2rem 0 0;
        margin-top: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
        padding: 0 1rem;
    }

    .footer-section {
        padding: 1.5rem 1rem;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 8px;
        margin-bottom: 1rem;
    }

    .footer-section:first-child {
        background: rgba(40, 167, 69, 0.1);
        border: 1px solid rgba(40, 167, 69, 0.2);
    }

    .footer-section h3 {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    .footer-section h4 {
        font-size: 1.1rem;
        margin-bottom: 1.2rem;
    }

    .footer-section p {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
        color: #ecf0f1;
    }

    .footer-list {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
    }

    .footer-list a {
        justify-content: center;
        font-size: 0.9rem;
        padding: 0.8rem;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 6px;
        transition: all 0.3s ease;
    }

    .footer-list a:hover {
        background: rgba(40, 167, 69, 0.2);
        transform: none;
        padding-left: 0.8rem;
    }

    .social-links {
        justify-content: center;
        margin-top: 1.5rem;
        gap: 1.5rem;
    }

    .social-links a {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    /* Guide Page */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .use-cases {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .privacy-box {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Article */
    .guide-article {
        padding: 2rem 1rem;
        margin: 1.5rem 0;
    }

    .article-header {
        margin-bottom: 2rem;
    }

    .article-header h2 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .article-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .article-section {
        margin-bottom: 2rem;
    }

    .article-section h3 {
        font-size: 1.3rem;
        padding-left: 0.5rem;
    }

    .article-section p {
        text-align: left;
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .container {
        padding: 0 0.8rem;
    }

    /* Hero */
    .hero {
        padding: 1.5rem 0;
    }

    .hero-title {
        font-size: 3rem;
        margin-bottom: 0.8rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    /* Sections */
    .input-section, 
    .guide-section,
    .guide-article {
        padding: 1rem 0.8rem;
        margin: 1rem 0;
    }

    .result-container,
    .images-grid {
        padding: 1rem 0.8rem;
    }

    /* Navigation */
    .nav-container {
        padding: 0.8rem 1rem;
    }

    .nav-brand h2 {
        font-size: 1.2rem;
    }

    .nav-links {
        gap: 0.8rem;
    }

    .nav-links a {
        font-size: 0.8rem;
        padding: 0.5rem 0.3rem;
        white-space: nowrap;
    }

    /* Ensure horizontal layout is maintained */
    .nav-container {
        flex-wrap: nowrap;
    }

    .nav-brand {
        flex-shrink: 0;
        min-width: 0;
    }

    .nav-links {
        flex-shrink: 0;
    }

    /* Images */
    .images-list {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }

    .image-preview {
        height: 100px;
    }

    .image-info {
        font-size: 0.8rem;
    }

    /* Footer */
    .footer {
        margin-top: 1.5rem;
    }

    .footer-content {
        gap: 1.5rem;
        padding: 0 0.5rem;
    }

    .footer-section {
        padding: 1rem 0.8rem;
        margin-bottom: 0.8rem;
    }

    .footer-section h3 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }

    .footer-section h4 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .footer-section p {
        font-size: 0.85rem;
        margin-bottom: 1.2rem;
    }

    .footer-list {
        gap: 0.6rem;
    }

    .footer-list a {
        font-size: 0.85rem;
        padding: 0.7rem 0.5rem;
    }

    .footer-bottom {
        padding: 1rem 0;
    }

    .footer-text {
        font-size: 0.8rem;
    }

    .social-links {
        gap: 1rem;
        margin-top: 1.2rem;
    }

    .social-links a {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

    /* Article */
    .article-header h2 {
        font-size: 1.8rem;
    }

    .article-section h3 {
        font-size: 1.2rem;
    }

    .article-section p {
        font-size: 0.9rem;
    }

    /* Buttons */
    .btn {
        font-size: 0.9rem;
        padding: 0.8rem 1rem;
    }

    .btn-sm {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .image-item:hover,
    .feature-item:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.98);
    }

    .social-links a:hover {
        transform: none;
    }

    .social-links a:active {
        transform: scale(0.95);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .input-section, .guide-section {
        padding: 1rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .images-list {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
.fa-spin {
    animation: fa-spin 2s infinite linear;
}

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

/* Article Styles */
.guide-article {
    background: #fff;
    border-radius: 10px;
    padding: 3rem 2rem;
    margin: 3rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    line-height: 1.7;
}

.article-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid #28a745;
}

.article-header h2 {
    color: #28a745;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.article-subtitle {
    font-size: 1.2rem;
    color: #666;
    font-style: italic;
    max-width: 600px;
    margin: 0 auto;
}

.article-content {
    max-width: 900px;
    margin: 0 auto;
}

.article-section {
    margin-bottom: 2.5rem;
}

.article-section h3 {
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 4px solid #28a745;
}

.article-section p {
    margin-bottom: 1.2rem;
    text-align: justify;
    font-size: 1rem;
    color: #444;
}

.article-section .highlight-green {
    background: linear-gradient(120deg, #28a745 0%, #28a745 100%);
    background-repeat: no-repeat;
    background-size: 100% 0.3em;
    background-position: 0 88%;
    color: #155724;
    font-weight: 600;
    padding: 0 0.2em;
}

.article-section .highlight-yellow {
    background: linear-gradient(120deg, #ffc107 0%, #ffc107 100%);
    background-repeat: no-repeat;
    background-size: 100% 0.3em;
    background-position: 0 88%;
    color: #856404;
    font-weight: 600;
    padding: 0 0.2em;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-success {
    color: #28a745;
}

.text-error {
    color: #dc3545;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-2 {
    margin-top: 2rem;
}
