/* Google Font for a modern look (optional, can be removed to inherit from theme) */
/* @import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700&display=swap'); */

:root {
    --primary-color: #0078d4;
    --primary-color-dark: #005a9e;
    --border-color: #e1e1e1;
    --background-color: #f9f9f9;
    --card-background: #ffffff;
    --text-color: #333;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    /* To inherit font from your WordPress theme, the next line is commented out */
    /* font-family: 'Vazirmatn', sans-serif; */
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
}

#color-tools-app {
    border: 1px solid var(--border-color);
    padding: 0;
    border-radius: 8px;
    background: var(--card-background);
    box-shadow: var(--shadow);
    max-width: 950px;
    margin: 20px auto;
    overflow: hidden;
}

/* Tabs / Ribbon */
.tabs-container {
    background: #f3f2f1;
    padding: 5px 15px 0 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tab-link {
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease-in-out;
    border-radius: 5px 5px 0 0;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-link:hover { background-color: #e9e9e9; }
.tab-link.active {
    background: var(--card-background);
    border-color: var(--border-color);
    position: relative;
    font-weight: 600;
    color: var(--primary-color);
}
.tab-link.active::after {
    content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 1px; background: var(--card-background);
}

/* Content Area */
.content-area { padding: 25px; }
.tab-content { display: none; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.tab-content.active { display: block; }

/* General Sections & Cards */
.tool-section, .output-section {
    background: #fafafa;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}
.controls-section { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
h4 { margin-top: 0; margin-bottom: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }

/* --- Tool 1: Color Picker --- */
.tool-grid { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
.picker-section { padding: 10px; }
#picker-container { margin: 0 auto; max-width: 100%; }
#picker-container .iro__slider {
    margin-top: 20px;
}
#selected-color-preview {
    width: 100%;
    height: 120px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 1.2em;
    font-weight: bold;
    transition: background-color 0.2s;
}
.light-text { color: white; }
.dark-text { color: black; }

#color-values .value-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    background: #f3f2f1;
    padding: 8px;
    border-radius: 4px;
    font-family: monospace;
}
.value-row .copy-btn {
    background: none; border: none; cursor: pointer; color: #555; padding: 5px;
}
.value-row .copy-btn:hover { color: var(--primary-color); }

/* --- Tool 2 & 3: Palettes --- */
.palette-display { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.palette-color {
    width: 65px; height: 65px; border-radius: 8px; cursor: pointer; transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); border: 2px solid transparent;
}
.palette-color:hover { transform: scale(1.1); box-shadow: 0 4px 10px rgba(0,0,0,0.15); }

/* Buttons */
.btn {
    padding: 10px 20px; border-radius: 5px; font-size: 15px; font-weight: 500;
    cursor: pointer; transition: all 0.2s; border: 1px solid transparent;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-color-dark); }
.btn-secondary { background-color: #e1e1e1; color: #333; }
.btn-secondary:hover { background-color: #ccc; }
.btn-danger { background: #fee; color: #c00; border: 1px solid #fdd; border-radius: 5px; }
.btn-danger:hover { background: #c00; color: #fff; }

#save-palette-btn {
    margin-top: 20px;
}

#saved-palettes-list .palette-display {
    padding: 10px; border-bottom: 1px solid #eee; align-items: center; justify-content: space-between;
}

/* --- Tool 3: Image Upload --- */
#image-drop-zone {
    border: 2px dashed #ccc; border-radius: 6px; padding: 30px; text-align: center;
    background-color: #fdfdfd; transition: all 0.3s ease;
}
#image-drop-zone.drag-over { border-color: var(--primary-color); background-color: #f0f8ff; }
#image-drop-zone i { font-size: 40px; color: #aaa; }
#image-drop-zone p { font-size: 1.1em; margin: 10px 0; }
#image-drop-zone span { color: #888; margin-bottom: 15px; display: block; }
.image-output { display: flex; flex-direction: column; align-items: center; }
#uploaded-image-preview {
    max-width: 100%; height: auto; max-height: 250px; margin-bottom: 20px;
    border: 1px solid var(--border-color); padding: 5px; border-radius: 4px;
}
.hidden { display: none; }

/* Misc */
.mobile-tool-title {
    display: none; /* Hidden by default on large screens */
}

#copy-tooltip {
    position: fixed; background-color: #222; color: #fff; padding: 5px 12px;
    border-radius: 5px; font-size: 14px; z-index: 9999; opacity: 0;
    transition: opacity 0.2s; pointer-events: none; transform: translate(-50%, -120%);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .tool-grid { grid-template-columns: 1fr; }
    .picker-section { padding: 0; }
    .tabs-container { padding: 5px 10px 0 10px; }
    .tab-link { padding: 8px 12px; }
    .tab-link span { display: none; } /* Hide text on small screens */
    .content-area { padding: 15px; }
    
    .mobile-tool-title {
        display: block; /* Shown only on small screens */
        font-size: 1.4em;
        font-weight: 600;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--border-color);
        color: var(--primary-color);
    }
}

@media (max-width: 480px) {
    body { font-size: 14px; }
    .palette-color { width: 50px; height: 50px; }
    #selected-color-preview { height: 100px; }
    .btn { padding: 8px 15px; font-size: 14px; }
}

.intro-section {
background: linear-gradient(45deg, var(--primary-color), #2e86de);
color: white;
padding: 40px 25px;
text-align: center;
border-radius: 8px;
margin-bottom: 25px;
}
.intro-content i {
font-size: 3em;
margin-bottom: 15px;
opacity: 0.8;
}
.intro-content h2 {
font-size: 1.8em;
font-weight: 700;
margin: 0 0 15px 0;
}
.intro-content p {
font-size: 1.1em;
max-width: 800px;
margin: 0 auto;
line-height: 1.8;
opacity: 0.9;
}

.section-title {
    text-align: center;
    font-size: 1.6em;
    margin-bottom: 30px;
    color: var(--text-color);
}
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.guide-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.guide-card h3 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
}
.guide-card ol {
    padding-right: 20px;
    margin: 0;
    line-height: 2;
}
.tips-section {
background: #f0f8ff;
border: 1px solid #d4e9fd;
padding: 30px;
border-radius: 8px;
margin-top: 25px;
}
.tips-section ul {
list-style: none;
padding: 0;
margin: 0;
}
.tips-section li {
display: flex;
gap: 15px;
align-items: flex-start;
margin-bottom: 15px;
line-height: 1.8;
}
.tips-section li i {
color: #28a745;
margin-top: 5px;
}
.features-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    text-align: center;
}
.feature-card {
    background: #fafafa;
    padding: 25px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.feature-card i {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 15px;
}
.feature-card h4 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
}
.feature-card p {
    margin: 0;
    font-size: 0.95em;
    color: #555;
    line-height: 1.6;
}

.tips-section {
    background: #f0f8ff;
    border: 1px solid #d4e9fd;
    padding: 30px;
    border-radius: 8px;
    margin-top: 25px;
}
.tips-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.tips-section li {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 18px; /* کمی فاصله بیشتر بین آیتم‌ها */
    line-height: 1.8;
}
.tips-section li:last-child {
    margin-bottom: 0; /* حذف فاصله از آخرین آیتم */
}
.tips-section li i {
    color: #28a745;
    margin-top: 6px; /* تنظیم دقیق‌تر آیکون در راستای متن */
}
.tips-section li div strong {
    margin-left: 5px; /* ایجاد فاصله استاندارد بعد از عنوان */
}