@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #10B981;
    --bg-color: #0F172A;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

html {
    overflow-y: scroll;
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.15) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-attachment: fixed;
}

/* Layout container */
.app-container {
    display: flex;
    width: 100%;
    max-width: 1200px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    min-height: 600px;
}

/* Left Sidebar - Logo Area */
.sidebar {
    width: 350px;
    background: rgba(15, 23, 42, 0.6);
    border-right: 1px solid var(--border-color);
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

.logo-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
    animation: float 6s ease-in-out infinite;
}

.sidebar h1 {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #fff, #94A3B8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.status-badge {
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--secondary);
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    position: relative;
}

.header {
    margin-bottom: 3rem;
}

.header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 1.05rem;
}

.custom-select {
    position: relative;
    width: 100%;
}

select {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-main);
    font-size: 1.1rem;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

select:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.6);
}

select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

select option {
    background: #1E293B;
    color: #fff;
    padding: 15px;
}

.select-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.product-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.6);
}

.product-card.selected {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
}

.product-card.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.product-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.product-img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    .app-container {
        flex-direction: column;
        height: auto;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem 0.5rem;
    }
    .main-content {
        padding: 1rem 0.5rem;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .success-overlay {
        position: fixed;
        border-radius: 0;
        z-index: 9999;
    }
}

.product-name {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: auto; /* Pushes options to bottom if names are varying length */
    padding-bottom: 1rem;
}

.product-qty-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: auto;
}

.option-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.option-group label {
    margin-bottom: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.product-qty, .product-size {
    width: 70px;
    padding: 0.4rem;
    background: #1E293B;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: white;
    text-align: center;
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
}

.product-qty:focus, .product-size:focus {
    border-color: var(--primary);
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(79, 70, 229, 0.4);
}

.btn-submit:active {
    transform: translateY(1px);
}

.btn-submit:disabled {
    background: #475569;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

/* Success State overlay */
.success-overlay {
    position: fixed !important; /* Ekrana tam oturması için */
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important; 
    height: 100% !important; 
    background: rgba(15, 23, 42, 0.98) !important; /* Çok koyu opak (arka ile karışmaması için) */
    backdrop-filter: blur(10px);
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Her şeyin üstünde olması için */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.success-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.success-icon {
    width: 100px;
    height: 100px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 2rem;
    border: 2px solid var(--secondary);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.success-overlay h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.success-overlay p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.order-id-display {
    font-size: 2rem;
    font-family: monospace;
    color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
    padding: 1rem 2rem;
    border-radius: 12px;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    border: 1px dashed var(--primary);
}

.btn-reset {
    padding: 1rem 2rem;
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: none;
}

.btn-submit.loading .spinner {
    display: block;
}

.btn-submit.loading .btn-text {
    display: none;
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

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

@keyframes scaleIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Responsive Design */
@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
        border-radius: 20px;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 2rem;
    }
    
    .main-content {
        padding: 2rem;
    }
    
    .success-overlay {
        border-radius: 0 0 20px 20px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    .sidebar {
        padding: 1rem 0.5rem;
    }
    .main-content {
        padding: 1rem 0.5rem;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

@media (max-width: 500px) {
    body {
        padding: 0.25rem;
    }
    .sidebar {
        padding: 1rem 0.25rem;
    }
    .main-content {
        padding: 1rem 0.25rem;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}
