/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    background-color: #0d1117;
    color: #e6edf3;
    line-height: 1.5;
    min-height: 100vh;
}

/* Header */
.header {
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 0.75rem 0.5rem;
    text-align: center;
}

.header h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 600;
    color: #f0f6fc;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    color: #7d8590;
    font-weight: 400;
}

/* Main Container */
.container {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Main Form Section */
.main-form {
    background-color: #0d1117;
}

.form-container {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.form-container h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: #f0f6fc;
    text-align: center;
}

.form-help {
    display: block;
    margin-top: 4px;
    font-size: 0.85em;
    color: #666;
    line-height: 1.4;
}

.form-help a {
    color: #007bff;
    text-decoration: none;
}

.form-help a:hover {
    text-decoration: underline;
}

.processing-note {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    color: #7d8590;
    font-style: italic;
    font-weight: bold;
}

/* Status Message Styles - Single Line */
.status-message {
    padding: 12px 20px;
    margin: 15px 0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: none;
    transition: all 0.3s ease;
}

.status-message.processing {
    background-color: #E3F2FD; /* Light Blue */
    color: #1565C0; /* Dark Blue */
    border: 1px solid #90CAF9;
}

.status-message.success {
    background-color: #E8F5E9; /* Light Green */
    color: #2E7D32; /* Dark Green */
    border: 1px solid #81C784;
}

.status-message.error {
    background-color: #FFEBEE; /* Light Red */
    color: #C62828; /* Dark Red */
    border: 1px solid #EF5350;
}

.status-message.warning {
    background-color: #FFF3E0; /* Light Orange/Yellow */
    color: #E65100; /* Dark Orange */
    border: 1px solid #FFB74D;
}

/* Sidebars */
.sidebar-left, .sidebar-right {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 1.5rem;
    height: fit-content;
}

/* Pricing Cards */
.pricing-card {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.pricing-card:hover:not(.disabled) {
    transform: translateY(-2px);
    border-color: #1f6feb;
}

.pricing-card.highlight {
    border-color: #238636;
    background-color: rgba(35, 134, 54, 0.05);
    transform: scale(1.02);
}

.pricing-card.disabled {
    opacity: 0.6;
}

.pricing-card h3 {
    margin-bottom: 0.5rem;
    color: #f0f6fc;
    font-size: 1.1rem;
}

.pricing-card .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #238636;
    margin-bottom: 0.5rem;
}

.pricing-card .description {
    margin-bottom: 1rem;
    color: #7d8590;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Review Section */
.review-section textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    resize: vertical;
    margin-bottom: 1rem;
    font-family: inherit;
}

.reviews {
    margin-top: 1.5rem;
}

.reviews h4 {
    margin-bottom: 1rem;
    color: #f0f6fc;
}

.review {
    padding: 1rem;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.review p {
    margin-bottom: 0.5rem;
    font-style: italic;
    line-height: 1.4;
    font-size: 0.875rem;
}

.review small {
    color: #7d8590;
    font-size: 0.75rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #e6edf3;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #1f6feb;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}

.form-group input:invalid {
    border-color: #da3633;
}

/* Validation Messages */
.license-info, .url-validation {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    min-height: 1.2rem;
}

.license-info.valid, .url-validation.valid {
    color: #3fb950;
}

.license-info.invalid, .url-validation.invalid {
    color: #f85149;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-disabled {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 120px;
}

.btn-primary {
    background-color: #238636;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2ea043;
}

.btn-primary:disabled {
    background-color: #30363d;
    color: #7d8590;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #21262d;
    color: #e6edf3;
    border: 1px solid #30363d;
}

.btn-secondary:hover {
    background-color: #30363d;
    border-color: #1f6feb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 111, 235, 0.3);
}

.btn-disabled {
    background-color: #161b22;
    color: #7d8590;
    border: 1px solid #30363d;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-large {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Status Messages */
.status-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    display: none;
}

.status-message.success {
    background-color: rgba(63, 185, 80, 0.15);
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, 0.4);
    display: block;
}

.status-message.error {
    background-color: rgba(248, 81, 73, 0.15);
    color: #f85149;
    border: 1px solid rgba(248, 81, 73, 0.4);
    display: block;
}

/* Showcase Section */
.showcase {
    margin-top: 3rem;
    padding: 2rem 0;
}

.showcase h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #f0f6fc;
}

/* Search Container with Autocomplete */
.search-container {
    text-align: center;
    margin-bottom: 2rem;
}

.search-wrapper {
    display: inline-block;
    position: relative;
    width: 300px;
}

.search-wrapper input {
    width: 100%;
    padding: 0.75rem;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.autocomplete-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #30363d;
    transition: background-color 0.2s ease;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background-color: #21262d;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

/* Showcase Navigation */
.showcase-navigation {
    display: flex;
    flex-direction: row !important;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #21262d;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #e6edf3;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 90px;
}

.nav-btn:hover:not(:disabled) {
    background-color: #30363d;
    border-color: #1f6feb;
    transform: translateY(-1px);
}

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

.nav-arrow {
    font-size: 1.1rem;
    font-weight: bold;
}

.showcase-counter {
    padding: 0.5rem 0.75rem;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #f0f6fc;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

@media (max-width: 768px) {
    .showcase-navigation {
        flex-direction: row !important;
        gap: 0.75rem;
        padding: 0.25rem;
    }
    
    .nav-btn {
        min-width: 80px;
        padding: 0.4rem 0.8rem;
        justify-content: center;
    }
    
    .nav-text {
        display: none;
    }
}

/* Showcase Container and Items */
.showcase-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    overflow: visible;
}

.showcase-item {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
    display: none;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    transition: height 0.3s ease;
}

.showcase-item.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

.showcase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #21262d;
    border-bottom: 1px solid #30363d;
    height: 60px;
    flex-shrink: 0;
}

.showcase-header h3 {
    font-size: 1rem;
    color: #f0f6fc;
    margin: 0;
}

.copy-btn {
    background: none;
    border: 1px solid #30363d;
    color: #e6edf3;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background-color: #30363d;
    border-color: #1f6feb;
}

.showcase-item textarea {
    width: 100%;
    min-height: 80px;
    padding: 1rem;
    background-color: #0d1117;
    color: #e6edf3;
    border: none;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    resize: none;
    transform: scale(0.85);
    transform-origin: top left;
    width: 117.65%;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    box-sizing: border-box;
    white-space: pre;
}

@media (max-width: 768px) {
    .showcase-container {
        padding: 0 0.5rem;
    }
    
    .showcase-item {
        max-width: 100%;
    }
    
    .showcase-item textarea {
        white-space: pre;
        transform: scale(0.8);
        width: 125%;
        font-size: 0.7rem;
        overflow-x: auto !important;
    }
}

@media (max-width: 480px) {
    .showcase-container {
        padding: 0 0.25rem;
    }
    
    .showcase-item textarea {
        white-space: pre;
        transform: scale(0.75);
        width: 133.33%;
        font-size: 0.65rem;
        overflow-x: auto !important;
    }
}

.social-icon {
    width: 70px;
    height: 70px;
    object-fit: contain;
    vertical-align: middle;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #161b22;
    border: 1px solid #30363d;
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    position: relative;
}

.close {
    color: #7d8590;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 10px;
}

.close:hover {
    color: #e6edf3;
}

.modal h2 {
    margin-bottom: 1rem;
    color: #f0f6fc;
}

.modal p {
    margin-bottom: 1.5rem;
    color: #7d8590;
}

/* Desktop Fixed Heights */
@media (min-width: 1201px) {
    .container {
        min-height: 800px;
    }
    
    .sidebar-left, 
    .sidebar-right, 
    .form-container {
        height: 800px;
        overflow-y: auto;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .showcase-container {
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .form-container, .sidebar-left, .sidebar-right {
        padding: 1rem;
    }
    
    .pricing-card {
        padding: 1rem;
    }
    
    .search-wrapper {
        width: 280px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem 0.5rem;
    }
    
    .container {
        padding: 0.5rem;
    }
    
    .pricing-card, .showcase-header {
        padding: 1rem;
    }
    
    .btn-large {
        font-size: 1rem;
    }
    
    .search-wrapper {
        width: 250px;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "...";
    animation: loading 1.4s infinite;
}

@keyframes loading {
    0%, 33% { content: "."; }
    34%, 66% { content: ".."; }
    67%, 100% { content: "..."; }
}

/* Focus States for Accessibility */
button:focus, input:focus, textarea:focus {
    outline: 2px solid #1f6feb;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pricing-card, .showcase-item, .review {
        border-width: 2px;
    }
}
