* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #0b0b16; /* Göndərdiyiniz tünd rəng */
    color: #e4e6eb;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

/* Mobil konteyner */
.mobile-container {
    width: 100%;
    max-width: 480px;
    background: #0b0b16;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Başlıq */
.app-header {
    background: #141424;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #1f1f35;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title h2 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.btn-icon-top {
    background: #3498db;
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Axtarış paneli */
.search-bar {
    padding: 15px;
    background: #0b0b16;
    position: relative;
    border-bottom: 1px solid #1f1f35;
}

.search-bar i {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: #8899a6;
}

.search-bar input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 1px solid #22223b;
    border-radius: 25px;
    font-size: 15px;
    outline: none;
    background: #141424;
    color: #fff;
    transition: all 0.3s;
}

.search-bar input:focus {
    border-color: #3498db;
    background: #1a1a2e;
}

/* DVR Kartlar Siyahısı */
.dvr-list {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    padding-bottom: 30px;
}

.dvr-card {
    background: #141424;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    border-left: 4px solid #3498db;
    border: 1px solid #1f1f35;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.customer-name {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.date-text {
    font-size: 11px;
    color: #8899a6;
}

.card-body-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: #b0c4de;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-item i {
    width: 16px;
    color: #8899a6;
}

.serial-badge {
    font-family: monospace;
    background: #1a2634;
    color: #5dade2;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.password-badge {
    font-family: monospace;
    background: #3c1f1f;
    color: #ec7063;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.card-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #1f1f35;
    padding-top: 8px;
    margin-top: 2px;
}

.note-text {
    font-size: 12px;
    color: #95a5a6;
    font-style: italic;
}

.card-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    padding: 5px;
}

.btn-edit-card { color: #f39c12; }
.btn-delete-card { color: #e74c3c; }

/* Modal Dizaynı (Mərkəzdə) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center; /* Ortaya yerləşdirir */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #141424;
    color: #fff;
    width: 100%;
    max-width: 480px;
    border-radius: 20px; /* Bütün künclər dairəvi olur */
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #2a2a40;
    /* Mərkəzdə yüngül böyüyərək açılma effekti */
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal.closing .modal-content {
    transform: scale(0.9);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #1f1f35;
    padding-bottom: 10px;
}

.modal-header h3 {
    font-size: 16px;
    color: #fff;
}

.close-btn {
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #b0c4de;
    margin-bottom: 4px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #22223b;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #0b0b16;
    color: #fff;
    resize: vertical;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: #3498db;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.btn-primary { background: #3498db; color: white; }
.btn-secondary { background: #22223b; color: #b0c4de; }

.loading-text, .empty-text {
    text-align: center;
    color: #8899a6;
    padding: 30px;
    font-size: 14px;
}

.date-text {
    font-size: 12px;
    color: #3498db;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.2s;
}
.date-text:hover {
    color: #5dade2;
    text-decoration: underline;
}

.pattern-container {
    position: relative;
    width: 220px;
    height: 220px;
    background: #0b0b16;
    border: 1px solid #22223b;
    border-radius: 12px;
    touch-action: none;
}

.pattern-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 20px;
    box-sizing: border-box;
    z-index: 2;
}

.pattern-dot {
    width: 18px;
    height: 18px;
    background: #2a2a40;
    border-radius: 50%;
    margin: auto;
    transition: background 0.2s, transform 0.2s;
}

.pattern-dot.active {
    background: #3498db;
    transform: scale(1.3);
}

.pattern-line-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.pattern-line-svg line {
    stroke: #3498db;
    stroke-width: 4;
    stroke-linecap: round;
}

/* Yüklənmə Spinner Animasiyası */
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
    color: #8899a6;
    font-size: 14px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(52, 152, 219, 0.2);
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#toastNotification {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    background: #e74c3c;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    
    /* İlkin vəziyyətdə ekranın xaricində (sağda) və şəffaf olur */
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

/* Göstərilən zaman ekranın içinə sürüşüb gəlir */
#toastNotification.show {
    display: block;
    transform: translateX(0);
    opacity: 1;
}