:root {
    --primary: #EC4899;
    --primary-hover: #BE185D;
    --bg-color: #2D142C;
    --card-bg: rgba(60, 20, 45, 0.6);
    --text-main: #FDF2F8;
    --text-muted: #FBCFE8;
    --border-color: rgba(244, 114, 182, 0.2);
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #E11D48;
}

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

body {
    background: linear-gradient(135deg, var(--bg-color) 0%, #170A1C 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Background Orbs */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.5;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: #F472B6;
    bottom: -150px;
    right: -100px;
}

/* Navbar */
.navbar {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #F9A8D4, #F472B6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    color: var(--text-main);
    -webkit-text-fill-color: var(--text-main);
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-main);
}

.app-container {
    width: 100%;
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
}

.hero-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.hero-section h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hero-section p {
    color: var(--text-muted);
    font-size: 1rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.drag-area {
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 3rem 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(255,255,255,0.02);
}

.drag-area.active {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.drag-area .icon svg {
    width: 60px;
    height: 60px;
    color: var(--primary);
    margin-bottom: 1rem;
}

.drag-area header {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.drag-area span {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0.5rem 0;
}

.drag-area button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    outline: none;
    background: var(--primary);
    color: #fff;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.3s;
}

.drag-area button:hover {
    background: var(--primary-hover);
}

.format-text {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.preview-section {
    animation: fadeIn 0.5s ease;
}

.preview-section h3, .result-section h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.canvas-container {
    width: 100%;
    height: 300px;
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.canvas-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.action-buttons button {
    flex: 1;
    padding: 0.875rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color) !important;
}

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

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 2.5rem;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    text-align: center;
}

.modal-overlay.show .modal-content {
    transform: translateY(0) scale(1);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.modal-body {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-actions button {
    flex: 1;
    padding: 0.875rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.modal-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.result-status {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.result-status.katarak {
    color: var(--danger);
}

.result-status.normal {
    color: var(--success);
}

.result-message {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* History Page Styles */
.history-container {
    width: 100%;
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 2rem;
    flex: 1;
    z-index: 1;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    color: var(--text-muted);
}

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

.history-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s;
}

.history-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.history-img-wrapper {
    width: 100%;
    height: 180px;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.history-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-info {
    padding: 1.5rem;
    text-align: center;
}

.history-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.history-result {
    font-weight: 700;
    font-size: 1.25rem;
}

.history-result.katarak {
    color: var(--danger);
}

.history-result.normal {
    color: var(--success);
}

footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

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

/* Loader for button */
.loader {
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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