/* =====================================================================
   CopyBoard — modern UI theme
   Bütün sınıf isimleri ve işlevsel davranışlar korunmuştur; yalnızca
   görsel katman modernleştirildi. Eski tarayıcılarla uyum için yalnızca
   yaygın desteklenen özellikler (flexbox, CSS değişkenleri, gradient,
   box-shadow, border-radius, transition) işlevsel olarak kullanıldı.
   ===================================================================== */

/* --------------------------------------------------------------------
   TEMA VE RENKLER
   -------------------------------------------------------------------- */
:root {
    /* metin ve yüzeyler */
    --color: #1f2430;
    --muted: #6b7280;
    --bg-color: #ffffff;          /* yüzey: kartlar, giriş alanı, timer arka planı */
    --page-bg: #eef1f6;           /* sayfa zemini */
    --border-color: #e6e8ee;
    /* vurgu rengi */
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-soft: rgba(79, 70, 229, 0.12);
    /* gölge */
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow: 0 4px 16px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);
    --radius: 14px;
    --radius-sm: 10px;
}

/* GECE TEMASI */
.night {
    --color: #e7e9ef;
    --muted: #9aa1ad;
    --bg-color: #191c22;          /* yüzey */
    --page-bg: #0d0f13;           /* sayfa zemini */
    --border-color: #2b2f38;
    --accent: #7c84ff;
    --accent-hover: #949bff;
    --accent-soft: rgba(124, 132, 255, 0.16);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
}

/* --------------------------------------------------------------------
   TEMEL
   -------------------------------------------------------------------- */
body {
    color: var(--color);
    background-color: var(--page-bg);
    background-image: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 70%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    padding-top: 8px;
    padding-bottom: 48px;
}

/* özel kaydırma çubuğu (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* --------------------------------------------------------------------
   ÜST BAŞLIK
   -------------------------------------------------------------------- */
#logo { transition: opacity 0.2s ease; }
#logo:hover { opacity: 0.85; }

.guide-btn {
    margin-left: 12px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--accent) !important;
    background: var(--accent-soft);
    transition: transform 0.15s ease, background-color 0.15s ease;
}
.guide-btn:hover { transform: translateY(-1px); background: var(--accent); color: #fff !important; }

/* --------------------------------------------------------------------
   OLUŞTURMA KARTI (form)
   -------------------------------------------------------------------- */
form {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
form:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow), 0 0 0 4px var(--accent-soft);
}

.note-input {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

#note {
    /* box-sizing content-box: JS yüksekliği (rows*24)+4 satır başına 24px'e
       göre hesaplar; border-box olsaydı padding içeriden yiyip tek satırda
       gereksiz kaydırma çubuğu oluşturuyordu. */
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    width: 100%;
    height: 28px;
    resize: none;
    padding: 2px;
    outline: none;
    border: none;
    transition: 0.5s;
    color: var(--color);
    background-color: var(--bg-color);
    font-size: 15px;
    line-height: 24px;
    overflow-x: hidden;
}
#note::-webkit-input-placeholder { color: var(--muted); }
#note::-moz-placeholder { color: var(--muted); opacity: 1; }
#note:-ms-input-placeholder { color: var(--muted); }
#note::placeholder { color: var(--muted); }

.note-input-clear {
    cursor: pointer;
    color: var(--muted);
    transition: color 0.15s ease;
}
.note-input-clear:hover { color: #dc2626; }

/* araç çubuğu — süre seçici (özel select) */
.note-duration {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: auto;
    height: auto;
    color: var(--color) !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    /* !important: HTML'deki .px-2 sınıfı (padding-left/right !important) aksi
       halde bu değerleri ezip chevron ile metnin üst üste binmesine yol açıyor */
    padding: 7px 34px 7px 15px !important;
    text-align: left;
    border: 1px solid var(--border-color) !important;
    border-radius: 999px !important;
    background-color: var(--page-bg) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 13px 13px;
    -webkit-box-shadow: none;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.note-duration:hover {
    border-color: var(--accent) !important;
    background-color: var(--accent-soft) !important;
}
.note-duration:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-soft) !important;
    outline: none;
}
.note-duration::-ms-expand { display: none; }
.note-duration option {
    color: #1f2430;
    background: #fff;
    font-weight: 500;
}
/* gece temasında açılır ok rengi daha açık */
.night .note-duration {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa1ad' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
.night .note-duration option { color: #e7e9ef; background: #191c22; }

/* --------------------------------------------------------------------
   DÜĞMELER
   -------------------------------------------------------------------- */
.btn {
    border-radius: var(--radius-sm);
    transition: transform 0.12s ease, background-color 0.15s ease,
                border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
    font-weight: 600;
}
.btn:active { transform: translateY(1px); }

/* gönder düğmesi (btn-info) */
.btn-info {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px var(--accent-soft);
}
.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.btn-info:not(:disabled):not(.disabled):active {
    background-color: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
    color: #fff;
    box-shadow: 0 4px 14px var(--accent-soft);
}
#send {
    width: 38px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* dosya seç düğmesi (btn-dark) — yumuşak accent tonlu ikon düğmesi */
#select_file {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm) !important;
    background-color: var(--accent-soft) !important;
    color: var(--accent) !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
}
#select_file:hover {
    background-color: var(--accent) !important;
    color: #fff !important;
    -webkit-transform: translateY(-1px);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--accent-soft) !important;
}
#select_file:active {
    -webkit-transform: translateY(0);
    transform: translateY(0);
}

/* not içi küçük eylem düğmeleri (btn-xs Bootstrap 4'te yok, burada tanımlı) */
.btn-xs {
    padding: 3px 10px;
    font-size: 12px;
    line-height: 1.4;
    border-radius: 999px;
    font-weight: 600;
}
.note-user-action { cursor: pointer; }
.note-user-action:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* --------------------------------------------------------------------
   TOGGLE ANAHTARLARI (tema + wi-fi paylaşımı)
   iOS tarzı kayan knob; bootstrap4-toggle'ın kayma mekaniği korunur.
   -------------------------------------------------------------------- */
.toggle.btn {
    border-radius: 999px !important;
    overflow: hidden;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.toggle .toggle-group {
    -webkit-transition: left 0.28s ease;
    transition: left 0.28s ease;
}

/* on/off etiketleri (ikonlar burada) — dikey/yatay ortalama */
.toggle-on,
.toggle-off {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    border: none !important;
    box-shadow: none !important;
    font-size: 13px;
}

/* OFF durumu (gündüz / herkese açık) — nötr yüzey */
.toggle.btn.off,
.toggle-off.btn-light {
    background-color: var(--bg-color) !important;
    color: var(--muted) !important;
}

/* ON durumu — tema (gece) = accent */
.toggle.btn.btn-secondary,
.toggle-on.btn-secondary {
    background-color: var(--accent) !important;
    color: #fff !important;
}
/* ON durumu — wi-fi paylaşımı = yeşil */
.toggle.btn.btn-success,
.toggle-on.btn-success {
    background-color: #22a06b !important;
    color: #fff !important;
}

/* handle gizli: durumu, kayan renkli pill ve ortalanmış ikon gösteriyor
   (klasik handle, overflow:hidden ile kenarda kesildiği için gizlendi) */
.toggle-handle {
    width: 0 !important;
    border: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
}
.toggle.btn:hover { border-color: var(--accent) !important; }
/* ikonların pill içindeki dikey hizası */
.toggle-on i,
.toggle-off i { line-height: 1; }

/* --------------------------------------------------------------------
   NOT LİSTELERİ
   -------------------------------------------------------------------- */
.note-pinned,
.note-main,
.note-search { margin-top: 18px; }

.note {
    position: relative;
    padding: 16px 18px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    font-family: inherit;
    color: var(--color);
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    -webkit-animation: noteIn 0.28s ease both;
    animation: noteIn 0.28s ease both;
}
.note:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--accent-soft);
}

@-webkit-keyframes noteIn {
    from { opacity: 0; -webkit-transform: translateY(8px); }
    to   { opacity: 1; -webkit-transform: translateY(0); }
}
@keyframes noteIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.note-content {
    word-wrap: break-word;
    padding: 0;
    padding-right: 8px;
}
.note-content img { cursor: pointer; border-radius: 8px; }

.note-content-div {
    position: relative;
    line-height: 1.6;
    font-size: 15px;
}
.note-content-div a {
    color: var(--accent);
    text-decoration: none;
    /* not: bu linkler taşma durumunda inline-block + width:100% olabiliyor;
       underline yerine text-decoration kullanılıyor ki çizgi kutuyu değil
       yalnızca metni kadar uzasın. */
    vertical-align: bottom;
}
.note-content-div a:hover { text-decoration: underline; }

.note-actions { line-height: 1; }

/* uzun notlar için katlama (collapse) */
.note-content-div.note-collapsed {
    max-height: 220px;
    overflow: hidden;
}
.note-content-div.note-collapsed::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    background: -webkit-linear-gradient(top, transparent, var(--bg-color));
    background: linear-gradient(to bottom, transparent, var(--bg-color));
    pointer-events: none;
}
.note-collapse-toggle {
    display: inline-block;
    margin-top: 10px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    transition: opacity 0.15s ease;
}
.note-collapse-toggle:hover { opacity: 0.75; }
.note-collapse-toggle i { margin-left: 5px; font-size: 11px; }

/* --------------------------------------------------------------------
   ROZETLER (etiketler)
   -------------------------------------------------------------------- */
.note-same-ip,
.note-result,
.note-pin,
.note-error {
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 0.3px;
    font-weight: 600;
    padding: 3px 10px;
    font-family: inherit;
    background-color: #22a06b;
    color: #fff;
    margin-right: 6px;
    margin-bottom: 4px;
    display: inline-block;
    white-space: nowrap;
    line-height: 1.5;
    vertical-align: middle;
}
.note-error { background-color: #dc2626 !important; }
.note-pin   { background-color: #7c3aed !important; }
.note-result { background-color: #6b7280 !important; }

/* --------------------------------------------------------------------
   NOT EYLEM SÜTUNU (kopyala + timer)
   -------------------------------------------------------------------- */
.note-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}
.note-copy { cursor: pointer; }
.note-copy i {
    color: var(--muted);
    transition: color 0.15s ease, transform 0.15s ease;
    font-size: 17px;
}
.note-copy:hover i { color: var(--accent); transform: scale(1.12); }

.note-timer { position: relative; }

/* --------------------------------------------------------------------
   YÜKLEME / DOSYA
   -------------------------------------------------------------------- */
.file-progress {
    max-width: 160px;
    display: none;
}
.file-name {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    cursor: pointer;
    width: 100%;
}
.file-image { max-width: 50%; border-radius: 10px; }
.file-video { max-width: 95%; border-radius: 10px; }
.file-remove {
    cursor: pointer;
    font-size: 25px;
    font-weight: bold;
    line-height: 1;
    transition: transform 0.15s ease;
}
.file-remove:hover { transform: scale(1.15); }

progress {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border: none;
    border-radius: 999px;
    background: var(--border-color);
    overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--border-color); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

/* --------------------------------------------------------------------
   iFRAME (YouTube gömme)
   -------------------------------------------------------------------- */
.iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 42%;
    height: 0;
    margin-top: 8px;
}
.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 75%;
    height: 100%;
    border-radius: 10px;
}

/* --------------------------------------------------------------------
   MODAL (görsel önizleme)
   -------------------------------------------------------------------- */
.modal-dialog {
    max-width: 80%;
    justify-content: center;
}
.modal-content {
    width: auto;
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    background: var(--bg-color);
}
#preview { border-radius: var(--radius); }
.modal-close {
    position: absolute;
    top: -42px;
    right: 0px;
    font-size: 24px;
    line-height: 34px;
    width: 34px;
    height: 34px;
    text-align: center;
    cursor: pointer;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 999px;
    transition: background-color 0.15s ease;
}
.modal-close:hover { background: rgba(0, 0, 0, 0.7); }

/* --------------------------------------------------------------------
   YARDIMCI
   -------------------------------------------------------------------- */
.no-transition { transition: none !important; }

/* --------------------------------------------------------------------
   DUYARLI (responsive)
   -------------------------------------------------------------------- */
@media only screen and (max-width: 1000px) {
    .iframe-container { padding-bottom: 56%; }
    .iframe-container iframe { width: 100%; }

    .note-action { display: block; }
    .note-copy,
    .note-timer {
        display: flex;
        justify-content: center;
    }
    .note-copy { margin-bottom: 20px; }

    .file-image { max-width: 100%; }
}

@media (max-width: 576px) {
    .note { padding: 14px 14px; }
    .modal-dialog {
        max-width: 100%;
        padding: 0 10px;
    }
}
