/* ==========================================================================
   KKTC Telekomünikasyon Dairesi - Ana Stil Dosyasi
   Renk Paleti: rehber.kktctelekom.org ile uyumlu
   ========================================================================== */

:root {
    --primary:       #006B8F;   /* Okyanus mavisi - ana renk */
    --primary-dark:  #004d68;   /* Koyu deniz mavisi */
    --primary-light: #1a8cb0;   /* Acik mavi */
    --secondary:     #005A8E;   /* Ikincil mavi - duyurular icin */
    --secondary-dark:#003f66;
    --accent:        #2E9E5B;   /* Zumrut yesil - vurgu */
    --accent-dark:   #1f7a43;   /* Koyu yesil */
    --accent-light:  #4dbf78;   /* Acik yesil */
    --teal:          #0d9488;   /* Teal - gecis tonu */
    --gold:          #f0a500;   /* Altin sari - one cikarma */
    --light-bg:      #f0f8f5;   /* Hafif yesilimsi beyaz */
    --light-blue-bg: #f0f5fa;   /* Hafif mavi arka plan */
    --border:        #c8e6d8;   /* Yesilimsi kenarlik */
    --text-dark:     #0f2d24;
    --text-muted:    #4a7a68;
    --white:         #ffffff;
    --shadow:        0 4px 20px rgba(0,107,143,0.14);
    --shadow-sm:     0 2px 8px rgba(0,107,143,0.09);
    --radius:        8px;
    --radius-lg:     12px;
    --transition:    0.25s ease;
}

/* --- Reset & Base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', 'Arial', sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-dark);
    background: var(--white);
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

/* --- Topbar ------------------------------------------------------------- */
.topbar {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    padding: 5px 0;
}
.topbar a { color: rgba(255,255,255,0.85); }
.topbar a:hover { color: var(--white); }

/* --- Navbar ------------------------------------------------------------- */
.navbar-main {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--teal) 100%);
    box-shadow: 0 2px 12px rgba(0,0,0,0.22);
    padding: 0;
}

.navbar-brand img { height: 52px; }

.navbar-main .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 1.1rem 1rem !important;
    position: relative;
    transition: color var(--transition);
}

.navbar-main .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%; right: 50%;
    height: 3px;
    background: var(--accent-light);
    transition: left var(--transition), right var(--transition);
}

.navbar-main .nav-link:hover,
.navbar-main .nav-link.active {
    color: var(--white) !important;
}

.navbar-main .nav-link:hover::after,
.navbar-main .nav-link.active::after {
    left: 0; right: 0;
}

.navbar-main .dropdown-menu {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 3px solid var(--primary);
}

.navbar-main .dropdown-item:hover {
    background: var(--light-bg);
    color: var(--primary);
}

/* --- Hero / Slider ------------------------------------------------------ */
.hero-slider {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-dark), var(--teal));
}

.hero-slider .carousel-item {
    height: 480px;
}

.hero-slider .carousel-item img {
    width: 100%;
    height: 480px;
    object-fit: cover;
    filter: brightness(0.65);
}

.hero-slider .carousel-caption {
    bottom: 60px;
    left: 10%;
    right: 10%;
    text-align: left;
}

.hero-slider .carousel-caption h2 {
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    margin-bottom: .5rem;
}

.hero-slider .carousel-caption p {
    font-size: 1.05rem;
    opacity: 0.92;
}

.hero-slider .carousel-indicators [data-bs-target] {
    width: 10px; height: 10px;
    border-radius: 50%;
    background-color: var(--accent-light);
}

/* --- Section Titles ----------------------------------------------------- */
.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.section-title h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.section-title .title-bar {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--primary), transparent);
    border-radius: 2px;
}

.section-title .icon-circle {
    width: 40px; height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* --- Cards -------------------------------------------------------------- */
.card-news {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
    height: 100%;
}

.card-news:hover {
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.card-news img {
    height: 180px;
    object-fit: cover;
    width: 100%;
}

.card-news .card-body {
    padding: 1.1rem;
}

.card-news .news-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: .3rem;
}

.card-news .card-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-news .card-text {
    font-size: .85rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Announcement List -------------------------------------------------- */
.announcement-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.announcement-item:last-child { border-bottom: none; }

.announcement-item .ann-icon {
    width: 36px; height: 36px;
    background: var(--light-bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.announcement-item.pinned .ann-icon {
    background: var(--accent);
    color: white;
}

.announcement-item h6 {
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-dark);
}

.announcement-item .ann-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* --- Quick Links -------------------------------------------------------- */
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.quick-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 12px;
    background: var(--light-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition);
    color: var(--primary);
    font-size: .85rem;
    font-weight: 500;
}

.quick-link-card:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.quick-link-card i {
    font-size: 1.6rem;
}

/* --- Page Hero ---------------------------------------------------------- */
.page-hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--teal) 100%);
    color: white;
    padding: 2.5rem 0;
    margin-bottom: 2rem;
}

.page-hero h1 { font-size: 1.8rem; font-weight: 700; }
.page-hero .breadcrumb-item { color: rgba(255,255,255,.75); }
.page-hero .breadcrumb-item a { color: var(--accent-light); }
.page-hero .breadcrumb-item.active { color: white; }
.page-hero .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.5); }

/* --- File Cards --------------------------------------------------------- */
.file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    transition: box-shadow var(--transition);
}

.file-item:hover { box-shadow: var(--shadow-sm); }

.file-item .file-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.file-icon.pdf { background: #fff0f0; color: #c00; }
.file-icon.word { background: #e8f0fe; color: #1a56db; }
.file-icon.excel { background: #e6f9ee; color: #168a43; }
.file-icon.zip { background: #fff8e1; color: #b45309; }
.file-icon.default { background: var(--light-bg); color: var(--primary); }

/* --- Admin Sidebar ------------------------------------------------------ */
.admin-sidebar {
    background: var(--primary-dark);
    min-height: calc(100vh - 60px);
    padding: 1.5rem 0;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,.8);
    padding: .65rem 1.5rem;
    border-radius: 0;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(255,255,255,.12);
    color: white;
    border-left: 3px solid var(--gold);
    padding-left: calc(1.5rem - 3px);
}

.admin-sidebar .nav-link i { width: 20px; text-align: center; }

.admin-sidebar .sidebar-section {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,.4);
    padding: 1rem 1.5rem .3rem;
    font-weight: 700;
}

/* --- Stats Cards (Admin) ------------------------------------------------ */
.stat-card {
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    right: -20px; bottom: -20px;
    width: 100px; height: 100px;
    background: rgba(255,255,255,.1);
    border-radius: 50%;
}

.stat-card .stat-num {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label { font-size: .85rem; opacity: .85; margin-top: 4px; }
.stat-card .stat-icon { font-size: 2rem; opacity: .6; }

/* --- Buttons ------------------------------------------------------------ */
.btn-primary-custom {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 500;
    border-radius: var(--radius);
    padding: .5rem 1.25rem;
    transition: all var(--transition);
}

.btn-primary-custom:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

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

.btn-accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: white;
}

/* --- Footer ------------------------------------------------------------- */
.footer-main {
    background: var(--primary-dark);
    color: rgba(255,255,255,.8);
    padding: 2.5rem 0 1rem;
    margin-top: 3rem;
}

.footer-main h5 {
    color: var(--gold);
    font-weight: 700;
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 1rem;
}

.footer-main a { color: rgba(255,255,255,.7); font-size: .88rem; }
.footer-main a:hover { color: var(--gold); }

.footer-main .footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    margin-top: 1.5rem;
    padding-top: 1rem;
    font-size: .82rem;
    color: rgba(255,255,255,.5);
}

/* --- Ticker / Duyuru Bandi --------------------------------------------- */
/* Renkler aynen korundu, sadece akisin kesintisiz olmasi icin yapi guclendirildi. */
.ticker-wrap {
    background: var(--accent);
    color: white;
    overflow: hidden;
    padding: 6px 0;
    display: flex;
    align-items: center;
}

.ticker-label {
    background: var(--accent-dark);
    padding: 0 16px;
    font-weight: 700;
    font-size: .85rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    height: 100%;
}

.ticker-items {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
}

.ticker-inner {
    display: inline-flex;
    align-items: center;
    gap: 60px;
    width: max-content;
    padding-right: 60px;
    white-space: nowrap;
    will-change: transform;
    animation: ticker-scroll 30s linear infinite;
}

.ticker-items:hover .ticker-inner {
    animation-play-state: paused;
}

.ticker-inner a {
    color: white;
    font-size: .85rem;
    display: inline-block;
    flex-shrink: 0;
    white-space: nowrap;
}

@keyframes ticker-scroll {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-50%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .ticker-inner { animation: none; }
}

/* --- Pagination --------------------------------------------------------- */
.pagination .page-link {
    color: var(--primary);
    border-color: var(--border);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* --- Alert/Flash Messages ---------------------------------------------- */
.alert-custom {
    border-radius: var(--radius);
    border: none;
    font-size: .9rem;
}

/* --- Badge -------------------------------------------------------------- */
.badge-pinned {
    background: var(--accent);
    color: white;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 20px;
}

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 768px) {
    .hero-slider .carousel-item,
    .hero-slider .carousel-item img { height: 280px; }
    .hero-slider .carousel-caption h2 { font-size: 1.3rem; }
    .hero-slider .carousel-caption { bottom: 20px; }
    .quick-links-grid { grid-template-columns: repeat(3, 1fr); }
}

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

/* --- Admin Responsive --------------------------------------------------- */
@media (max-width: 992px) {
    .admin-sidebar { display: none; }
    .admin-content { padding: 1rem; }
}

/* --- Yardimci Siniflar -------------------------------------------------- */
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.text-primary-custom { color: var(--primary); }
.text-accent { color: var(--accent); }
.bg-primary-custom { background: var(--primary); }
.bg-accent { background: var(--accent); }

/* --- Haber Icerik Stili ------------------------------------------------- */
.news-content h1, .news-content h2, .news-content h3 {
    color: var(--primary);
    margin-top: 1.5rem;
    margin-bottom: .75rem;
}
.news-content p { margin-bottom: 1rem; }
.news-content img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 1rem 0;
}
.news-content ul, .news-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.news-content a { color: var(--primary); text-decoration: underline; }
.news-content blockquote {
    border-left: 4px solid var(--accent);
    padding: .75rem 1rem;
    background: var(--light-bg);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1rem 0;
    color: var(--text-muted);
    font-style: italic;
}

/* --- Form Focus Renkleri ------------------------------------------------ */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(0,107,143,.15);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* --- Table Hover -------------------------------------------------------- */
.table-hover > tbody > tr:hover > * {
    background-color: rgba(0,107,143,.04);
}

/* --- Skeleton / Loading ------------------------------------------------- */
.skeleton {
    background: linear-gradient(90deg, #e8f0ec 25%, #d0e4d8 50%, #e8f0ec 75%);
    background-size: 200% 100%;
    animation: skeleton-load 1.5s infinite;
    border-radius: var(--radius);
}
@keyframes skeleton-load {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}