/**
 * TPL SOFT - Components CSS
 * Kart, buton, form, badge bileşenleri
 */

/* ──────────────────────────────────────────────── */
/* KART BİLEŞENİ                                     */
/* ──────────────────────────────────────────────── */

.card {
    background: rgba(22, 22, 22, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.card:hover {
    border-color: var(--border-red);
    box-shadow: var(--shadow-red);
    transform: translateY(-4px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.card-body {
    margin-bottom: var(--space-md);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.card-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
}

.card-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--surface-2);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ──────────────────────────────────────────────── */
/* BUTONLAR                                          */
/* ──────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 28px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
    text-decoration: none;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--red-light);
    color: var(--white);
    box-shadow: var(--shadow-red);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--red);
    color: var(--red);
}

.btn-outline:hover:not(:disabled) {
    background: var(--red);
    color: var(--white);
}

.btn-ghost {
    background: transparent;
    color: var(--red);
    padding: 8px 16px;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--surface-2);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1rem;
}

/* ──────────────────────────────────────────────── */
/* FORMLAR                                           */
/* ──────────────────────────────────────────────── */

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text);
    margin-bottom: var(--space-sm);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-dim);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-error {
    display: block;
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: var(--space-xs);
}

.form-hint {
    display: block;
    color: var(--text-dim);
    font-size: 0.8125rem;
    margin-top: var(--space-xs);
}

/* ──────────────────────────────────────────────── */
/* BADGE                                             */
/* ──────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-red {
    background: rgba(220, 20, 40, 0.15);
    color: var(--red);
}

.badge-green {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.badge-gray {
    background: var(--surface-2);
    color: var(--text-muted);
}

/* ──────────────────────────────────────────────── */
/* GRID SİSTEMLERİ                                   */
/* ──────────────────────────────────────────────── */

.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .grid-auto-fit {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .grid {
        gap: var(--space-md);
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.875rem;
    }

    .btn-lg {
        padding: 12px 24px;
    }

    .card {
        padding: var(--space-md);
    }

    .card-title {
        font-size: 1.125rem;
    }
}

/* ──────────────────────────────────────────────── */
/* FLEX UTILITIES                                   */
/* ──────────────────────────────────────────────── */

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ──────────────────────────────────────────────── */
/* SPACING UTILITIES                                */
/* ──────────────────────────────────────────────── */

.mt-auto { margin-top: auto; }
.mb-auto { margin-bottom: auto; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* ──────────────────────────────────────────────── */
/* TOAST NOTIFICATION                               */
/* ──────────────────────────────────────────────── */

#toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: var(--space-md) var(--space-lg);
    background: var(--surface-2);
    border-left: 4px solid var(--success);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 500;
    min-width: 280px;
    animation: slideInRight 0.3s ease forwards;
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-info {
    border-left-color: var(--info);
}

/* ──────────────────────────────────────────────── */
/* MODAL                                             */
/* ──────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--surface-3);
    color: var(--text);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
}

/* ──────────────────────────────────────────────── */
/* DROPZONE                                          */
/* ──────────────────────────────────────────────── */

.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-2xl);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.dropzone:hover,
.dropzone.drag-over {
    border-color: var(--red);
    background: var(--red-glow-lg);
}

.dropzone-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-md);
    color: var(--text-muted);
}

.dropzone-text {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.dropzone-hint {
    color: var(--text-dim);
    font-size: 0.8125rem;
    margin-top: var(--space-sm);
}

.dropzone-preview {
    margin-top: var(--space-md);
    max-width: 200px;
    border-radius: var(--radius-sm);
    display: none;
}

.dropzone-preview.show {
    display: block;
}
