/* Import coding-style fonts */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Fira+Code:wght@400;500;600;700&display=swap');

/* Modern CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #000000; /* Pure AMOLED black */
    background-image: radial-gradient(circle, #333333 1px, transparent 1px);
    background-size: 20px 20px;
    color: #FFFFFF;
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Splash Screen Styles */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    background-image: radial-gradient(circle, #333333 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.splash-logo {
    font-family: 'JetBrains Mono', 'Fira Code', 'Source Code Pro', 'Consolas', monospace;
    font-size: 3rem;
    font-weight: 600;
    color: #FFFFFF;
    text-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
    letter-spacing: 2px;
    position: relative;
}

@media (max-width: 768px) {
    .splash-logo {
        font-size: 1.8rem;
    }
}

/* Main Layout */
main {
    flex: 1;
    padding: 2rem 1rem;
    max-width: 800px;
    margin: 0 auto;
    margin-bottom: 100px;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
}

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

.hero h1 {
    font-family: 'JetBrains Mono', 'Fira Code', 'Source Code Pro', 'Consolas', monospace;
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 2px;
    color: #FFFFFF;
    text-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
    position: relative;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
        letter-spacing: 1px;
    }
}

.subtitle {
    font-size: 1.25rem;
    color: #999;
    max-width: 600px;
    margin: 0 auto;
}

/* Search Container */
.search-container {
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Model Selector */
.model-selector {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.model-selector select {
    background: #111111;
    color: #FFFFFF;
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
    will-change: border-color;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23FFFFFF' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 32px;
}

.model-selector select:hover {
    border-color: #555555;
}

.model-selector select:focus {
    border-color: #FFFFFF;
}

.model-selector option {
    background: #111111;
    color: #FFFFFF;
}

.search-box {
    background: #111111;
    border-radius: 16px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #333333;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
    width: 100%;
    transform: translateZ(0);
    will-change: border-color, box-shadow;
}

.search-box textarea {
    flex: 1;
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 1.1rem;
    outline: none;
    padding: 4px 0;
    font-weight: 400;
    resize: none;
    min-height: 24px;
    max-height: 150px;
    font-family: inherit;
    line-height: 1.5;
    overflow-y: auto;
    width: calc(100% - 50px);
}

.search-box textarea::placeholder {
    color: #666666;
    font-weight: 400;
}

/* Custom scrollbar for textarea */
.search-box textarea::-webkit-scrollbar {
    width: 4px;
}

.search-box textarea::-webkit-scrollbar-track {
    background: transparent;
}

.search-box textarea::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.search-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-btn {
    background: #FFFFFF;
    color: #000000;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transform: translateZ(0);
    will-change: transform, background-color;
}

.search-btn:hover {
    background: #CCCCCC;
    color: #000000;
    transform: translateY(-2px) translateZ(0);
    opacity: 1;
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.2);
}

.search-btn:active {
    transform: translateY(0) translateZ(0);
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Removed gradient border effect as requested */

.search-box:hover {
    border-color: #ffffff;
    animation: none;
}

.divider {
    width: 1px;
    height: 24px;
    background: #444;
}

button {
    background: none;
    border: none;
    color: rgb(255, 255, 255);
    cursor: pointer;
    font-size: 1.1rem;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.8;
}

/* Result Box */
.result-box {
    background: #111111;
    border-radius: 12px;
    padding: 24px 28px;
    margin-top: 20px;
    color: #FFFFFF;
    display: none;
    position: relative;
    border: 1px solid #333333;
}

.result-box p {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

/* Style for the header section in result box */
.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.perplexity-icon {
    width: 24px;
    height: 24px;
    background: #FFFFFF;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brief-overview {
    font-size: 18px;
    font-weight: 500;
    color: #FFFFFF;
}

/* Style for action buttons */
.action-buttons {
    position: static;
    display: flex;
    gap: 8px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #333;
    justify-content: flex-end;
}

.action-btn {
    background: transparent;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: auto;
}

.action-btn:hover {
    background: #E5E7EB;
    color: #1C1C1C;
    transform: none;
    box-shadow: none;
}

.action-btn.copied {
    background: #4CAF50;
    color: #FFFFFF;
}

.action-btn.rewrite {
    color: #9CA3AF;
    background: transparent;
}

.action-btn.rewrite:hover {
    background: #E5E7EB;
    color: #1C1C1C;
}

/* Suggestions */
.suggestions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.suggestion-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.suggestion-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #111111;
    border: 1px solid #333333;
    border-radius: 12px;
    padding: 12px 16px;
    color: #FFFFFF;
    font-size: 14px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    transform: translateZ(0);
    will-change: transform, background-color, border-color;
}

.suggestion-btn:hover {
    background: #222222;
    border-color: #555555;
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.1);
}

.suggestion-btn:active {
    transform: translateY(0) translateZ(0);
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.suggestion-btn span {
    flex-shrink: 0;
    font-size: 16px;
}

.suggestion-btn.blink {
    animation: blink 1s infinite;
    background: #111111;
    border: 1px solid #333333;
    color: #666666;
    cursor: default;
}

/* Mobile adjustments */
@media screen and (max-width: 600px) {
    .suggestion-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .suggestion-btn span {
        font-size: 14px;
    }
}

/* Loader */
.loader {
    width: 30px;
    height: 30px;
    border: 3px solid #444;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error Message */
.error {
    color: #ff6b6b;
    text-align: center;
}

/* Footer */
footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: #1C1C1C;
    margin-top: auto;
    position: fixed;
    bottom: 40px;
    left: 0;
    right: 0;
    z-index: 99;
}

footer p {
    display: inline-block;
    margin: 0 0.5rem;
}

footer a {
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 14px;
    padding: 5px 10px;
}

footer a:hover {
    color: #FFFFFF;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background: white;
    width: 90%;
    max-width: 600px;
    margin: 50px auto;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-height: 80vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
        padding: 0 10px;
    }
    
    .subtitle {
        font-size: 1rem;
        padding: 0 15px;
    }
    
    main {
        padding: 1rem 0;
    }
    
    .search-container {
        padding: 0 10px;
    }
    
    .search-box {
        padding: 8px 12px;
    }
    
    .search-box textarea {
        font-size: 16px;
    }
    
    .search-btn {
        padding: 6px 12px;
        font-size: 14px;
    }

    /* Adjust suggestion buttons for mobile */
    .suggestion-row {
        flex-direction: row;
        gap: 8px;
        padding: 0 5px;
    }

    .suggestion-btn {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    /* Adjust result box for mobile */
    .result-box {
        padding: 15px;
        margin: 10px 0;
    }

    /* Footer adjustments */
    footer {
        padding: 0.5rem;
        bottom: 35px;
    }

    footer a {
        font-size: 13px;
        padding: 4px 8px;
    }

    #rahul {
        padding: 8px;
    }

    #rahul a {
        font-size: 13px;
    }

    main {
        margin-bottom: 90px;
    }
}

/* Additional adjustments for very small screens */
@media (max-width: 380px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .search-box {
        padding: 8px 10px;
    }

    .search-btn {
        padding: 6px 10px;
    }
}
strong {
    font-weight: bold;
}

/* Update the content container styles */
.content-container {
    margin-top: 24px;
    padding: 0 12px;
    font-size: 16px;
    line-height: 1.8;
    color: #E5E7EB;
}

.content-container p {
    margin-bottom: 24px;
    letter-spacing: 0.3px;
}

.content-container p:last-child {
    margin-bottom: 0;
}

/* Add paragraph spacing within the content */
.result-box p + p {
    margin-top: 16px;
}

/* Remove the glow effect */
.action-btn:hover {
    box-shadow: none;
}

/* Page Content Styles */
.page-content {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    color: #E5E7EB;
}

.back-button {
    margin-bottom: 2rem;
}

.back-button a {
    color: #9CA3AF;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s;
}

.back-button a:hover {
    color: #FFFFFF;
}

.content-wrapper {
    background: #2A2A2A;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 4rem;
}

.content-wrapper h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #FFFFFF;
}

.content-wrapper h2 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    color: #FFFFFF;
}

.content-wrapper p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.content-wrapper ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

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

/* Update footer styles */
footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: #1C1C1C;
    margin-top: auto;
    position: fixed;
    bottom: 40px;
    left: 0;
    right: 0;
    z-index: 99;
}

footer p {
    display: inline-block;
    margin: 0 0.5rem;
}

footer a {
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 14px;
    padding: 5px 10px;
}

footer a:hover {
    color: #FFFFFF;
}

/* Contact page specific styles */
.contact-info {
    background: #333;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.contact-info h2 {
    color: #FFFFFF;
    margin-top: 1.5rem;
}

.contact-info h2:first-child {
    margin-top: 0;
}

/* Add these styles for the developer credit */
#rahul {
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1C1C1C;
    padding: 10px;
    margin: 0;
    z-index: 100;
}

#rahul a {
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 14px;
    padding: 5px 10px;
}

#rahul a:hover {
    color: #FFFFFF;
}

.loading-suggestion {
    animation: pulse 1.5s infinite;
    opacity: 0.7;
    cursor: default !important;
    background: #f0f0f0 !important;
    color: #666 !important;
}

@keyframes pulse {
    0% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 0.7;
    }
}

.error-suggestion {
    background: #fff0f0 !important;
    color: #d32f2f !important;
    cursor: default !important;
}

.blink {
    animation: blink 1s infinite;
    background: #2A2A2A !important;
    color: #666 !important;
    cursor: default !important;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.ai-searching {
    padding: 4px;
    margin: 8px 0;
    text-align: center;
}

.search-progress {
    background: transparent;
    padding: 6px;
    border: none;
}

.step-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step-dot {
    width: 5px;
    height: 5px;
    background: #666;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.step-text {
    color: #999;
    font-size: 13px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.step.active {
    opacity: 1;
}

.step.active .step-dot {
    background: #4CAF50;
    box-shadow: 0 0 6px #4CAF50;
    animation: pulse 1s infinite;
}

.step.active .step-text {
    color: #fff;
    font-size: 14px;
}

.step.completed {
    opacity: 0.8;
}

.step.completed .step-dot {
    background: #4CAF50;
}

.step.completed .step-text {
    color: #4CAF50;
    font-size: 13px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Mobile-specific styles */
@media screen and (max-width: 600px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .search-container {
        width: 95%;
        padding: 10px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .suggestion-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .result-box {
        padding: 15px;
    }
    
    .action-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .action-btn {
        flex: 1;
        min-width: 120px;
    }
}

/* Ensure suggestions stay 2x2 on all screen sizes */
.suggestions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.suggestion-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.suggestion-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.suggestion-btn span {
    flex-shrink: 0;
}
