/* --- String Art - Nihai Tema --- */

/* === BÖLÜM 1: TEMEL YAPI VE RENK PALETİ === */
:root {
    --background-color: #CCC3B1; /* YENİ: Ana Zemin Rengi */
    --text-color: #313131;
    --primary-color: #B08D57; /* Ana Vurgu Rengi (Puslu Altın) */
    --alt-color: #9C7B47;     /* YENİ: İkincil Vurgu Rengi (Daha Koyu Altın) */
    --border-color: #EAEAEA;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}
.container { max-width: 800px; width: 100%; }
header { text-align: center; margin-bottom: 3rem; border-bottom: 1px solid var(--border-color); padding-bottom: 2rem; }
h1 { font-family: var(--font-heading); color: var(--text-color); font-size: 3rem; margin: 0 0 0.5rem 0; }
header p { font-size: 1.1rem; color: #707070; max-width: 600px; margin: 0 auto; }
h2 { font-family: var(--font-heading); color: var(--text-color); border-bottom: 1px solid var(--primary-color); padding-bottom: 0.75rem; margin-top: 0; margin-bottom: 1.5rem; font-size: 2rem; }
h3 { font-family: var(--font-heading); color: var(--text-color); }
p { line-height: 1.7; }
main { width: 100%; }
.card { background: #fbeee0; padding: 2.5rem; border-radius: 4px; border: 1px solid var(--border-color); box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05); margin-bottom: 2.5rem; }
.hidden { display: none !important; }

/* === BÖLÜM 2: BUTONLAR VE FORMLAR === */
/* Ortak Buton Stilleri */
.button,
.button-secondary,
.step-button {
  padding: 0 18px;
  line-height: 50px;
  border: 2px solid #422800;
  border-radius: 30px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  text-align: center;
  display: inline-block;
  background-color: #F5F1E9; /* Krem-bej ton */
  color: #422800; /* Koyu kahverengi */
  box-shadow: #422800 4px 4px 0 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.button:hover,
.button-secondary:hover,
.step-button:hover {
  background-color: #ffffff;
  box-shadow: #422800 6px 6px 8px rgba(66, 40, 0, 0.3);
  transform: translateY(-2px);
}

.button:active,
.button-secondary:active,
.step-button:active {
  box-shadow: #422800 2px 2px 0 0;
  transform: translate(2px, 2px);
}

/* Dosya Seçme Butonu (Label) */
.file-input-label {
  padding: 0 18px;
  line-height: 50px;
  border: 2px solid #422800;
  border-radius: 30px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: inline-block;
  background-color: #F5F1E9; /* Krem-bej ton */
  color: #422800; /* Koyu kahverengi */
  box-shadow: #422800 4px 4px 0 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.file-input-label {
  white-space: nowrap;     /* Tek satırda kalması için */
  min-width: 140px;        /* Minimum genişlik */
  overflow: hidden;
  text-overflow: ellipsis; /* Taşma olursa ... göster */
}

@media (max-width: 480px) {
  .file-input-label {
    white-space: normal;    /* Mobilde satırlar ayrılabilir */
    line-height: normal;    /* Daha rahat satır yüksekliği */
    padding: 10px 18px;     /* Dikey boşluk biraz arttı */
    width: 100%;            /* Tam genişlik */
    box-sizing: border-box; /* Padding dahil genişlik */
  }
}


.file-input-label:hover {
  background-color: #ffffff;
  box-shadow: #422800 6px 6px 8px rgba(66, 40, 0, 0.3);
  transform: translateY(-2px);
}

.file-input-label:active {
  box-shadow: #422800 2px 2px 0 0;
  transform: translate(2px, 2px);
}

.button-secondary {
  background-color: #F5F1E9; /* Açık krem ton */
  border: 2px solid #422800;
  border-radius: 30px;
  box-shadow: #422800 4px 4px 0 0;
  color: #422800;
  cursor: pointer;
  display: inline-block;
  font-weight: 600;
  font-size: 18px;
  padding: 0 18px;
  line-height: 50px;
  text-align: center;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: all 0.2s ease;
}

.button-secondary:hover {
  background-color: #ffffff;
  border-color: #422800;
}

.button-secondary:active {
  box-shadow: #422800 2px 2px 0 0;
  transform: translate(2px, 2px);
}

@media (min-width: 768px) {
  .button-secondary {
    min-width: 120px;
    padding: 0 25px;
  }
}
/* YENİ: Özel butonlar için yeni renk sınıfı */
.button-alt {
    background-color: var(--alt-color);
    color: white;
}
.button-alt:hover {
    background-color: #8a6d41;
}

#upload-section { text-align: center; }
#upload-section p { margin-bottom: 1.5rem; }
.file-input-wrapper { display: flex; justify-content: center; align-items: center; gap: 1rem; }
@media (max-width: 480px) {
  .file-input-wrapper {
    flex-direction: column;   /* Sütun düzeni */
    gap: 0.5rem;              /* Daha az boşluk */
  }
}

.file-input-hidden { display: none; }
#file-name-display { font-style: italic; }
#file-name-display {
  color: #422800;
}

@media (max-width: 480px) {
  #file-name-display {
    font-size: 0.85rem;
    text-align: center;
    width: 100%;
    margin-top: 0.3rem;
  }
}
/* === BÖLÜM 3: GENEL DÜZEN VE MODALLAR === */
.spinner { border: 8px solid #f3f3f3; border-top: 8px solid var(--primary-color); border-radius: 50%; width: 60px; height: 60px; animation: spin 2s linear infinite; margin: 20px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: #fff; padding: 2rem; border-radius: 4px; width: 90%; max-width: 600px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); position: relative; }
.cropper-container-modal { width: 100%; height: 400px; margin-top: 1rem; margin-bottom: 1.5rem; }
.close-button { position: absolute; top: 10px; right: 20px; background: none; border: none; font-size: 2.5rem; color: #aaa; cursor: pointer; line-height: 1; padding: 0; }
.close-button:hover { color: #333; }
.modal-action-buttons { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }

/* === BÖLÜM 4: ÖNİZLEME VE ONAY STİLLERİ === */
#thumbnail-container { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.thumbnail-wrapper { text-align: center; cursor: pointer; border: 3px solid transparent; border-radius: 8px; padding: 5px; transition: all 0.2s ease-in-out; }
.thumbnail-wrapper:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); }
.thumbnail-wrapper.active { border-color: var(--primary-color); }
.thumbnail { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }
.thumbnail-wrapper span { display: block; margin-top: 0.5rem; font-weight: 500; font-size: 0.9rem;}
#large-preview-container { width: 100%; height: auto; aspect-ratio: 1/1; margin: 0 auto 1.5rem auto; overflow: hidden; border: 1px solid var(--border-color); display: flex; justify-content: center; align-items: center; background-color: #f9f9f9; touch-action: manipulation; }
#large-preview-image { width: 100%; height: 100%; object-fit: contain; transition: transform 0.2s ease-out; cursor: zoom-in; transform-origin: center center; }
#large-preview-image.zoomed { cursor: zoom-out; }
#get-instructions-btn:disabled { background-color: #bdc3c7; border-color: #bdc3c7; cursor: not-allowed; transform: none; box-shadow: none; }
.action-buttons { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.confirmation-preview { text-align: center; margin: 2rem 0; }
.confirmation-preview img { max-width: 100%; max-height: 400px; border-radius: 4px; border: 1px solid var(--border-color); }
.confirmation-buttons { display: flex; flex-direction: column; gap: 1rem; justify-content: center; margin-top: 1.5rem; }

/* === BÖLÜM 5: DASHBOARD VE OYNATICI STİLLERİ === */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; }
.project-card { background: #fff; border-radius: 4px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); text-decoration: none; color: var(--text-color); overflow: hidden; border: 1px solid var(--border-color); transition: all 0.3s ease; }
.project-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.project-card img { width: 100%; height: 200px; object-fit: cover; display: block; }
.project-info { padding: 1.25rem; }
.new-project-card { display: flex; flex-direction: column; justify-content: center; align-items: center; border: 2px dashed var(--border-color); }
.new-project-card:hover { border-color: var(--primary-color); }
.plus-icon { font-size: 4rem; color: #ccc; }
.progress-container { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.progress-container progress { width: 100%; flex: 1; -webkit-appearance: none; appearance: none; }
progress::-webkit-progress-bar { background-color: #eee; border-radius: 2px; }
progress::-webkit-progress-value { background-color: var(--primary-color); border-radius: 2px; }
.progress-text { margin: 0.25rem 0 0 0; font-size: 0.8rem; color: #7f8c8d; }
#result-image { max-width: 100%; border-radius: 4px; margin-bottom: 1.5rem; }
#animation-player { background-color: #f9f9f9; border-radius: 4px; padding: 1.5rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; width: 100%; box-sizing: border-box;}

/* OYNATICI ÇEMBERİ DÜZELTMELERİ */
#player-circle {
    box-shadow: 0 0 30px rgba(0,0,0,0.1), inset 0 0 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 350px;
    aspect-ratio: 1 / 1;
    background: #fff;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}
.segment {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--color);
    opacity: 0.3;
    transition: opacity 0.3s ease-in-out;
}
/* Yeni harf sistemine göre (k, m, y, s) */
.segment.k { clip-path: polygon(0 0, 50% 0, 50% 50%, 0 50%); }
.segment.m { clip-path: polygon(50% 0, 100% 0, 100% 50%, 50% 50%); }
.segment.y { clip-path: polygon(50% 50%, 100% 50%, 100% 100%, 50% 100%); }
.segment.s { clip-path: polygon(0 50%, 50% 50%, 50% 100%, 0 100%); }
.segment.active { opacity: 1; }
#current-pin-display {
    font-family: var(--font-heading);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    border-radius: 100%;
    padding: 1rem;
    font-size: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    color: #313131;
    font-weight: 700;
    width: auto;
    min-width: 100px;
    height: auto;
    min-height: 100px;
}

/* YENİ: Talimat Kaydırma Alanı */
.instruction-scroller {
    width: 100%;
    overflow-x: auto;
    text-align: center;
    white-space: nowrap;
    padding: 1rem 0;
    background-color: #e9e9e9;
    border-radius: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f0f0f0;
}
.instruction-item {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: 4px;
    background: #dcdcdc;
    color: #888;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}
.instruction-item.current {
    background: var(--alt-color);
    color: white;
    font-weight: bold;
    transform: scale(1.1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
#player-controls {
    width: 100%;
    max-width: 400px;
    justify-content: center;
    display: flex;
    gap: 1rem;
    align-items: center;
}
.step-button {
    background-color: var(--alt-color);
    padding: 12px;
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
}
#play-pause-btn {
    background-color: var(--alt-color);
    width: 120px;
    font-weight: 700;
    height: 50px;
}
#play-pause-btn.playing {
    background-color: #c0392b;
}
.speed-control {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
}

/* === MEDYA SORGULARI (Ekran boyutuna göre düzenlemeler) === */
@media (min-width: 600px) {
    .action-buttons, .confirmation-buttons, .modal-action-buttons { flex-direction: row; }
    .action-buttons > *, .confirmation-buttons > *, .modal-action-buttons > * { flex: 1; }
}