/* 
  PhotoKB Modern Design System 
  Author: PhotoKB Team 
  Target: 100/100 Core Web Vitals
*/

:root {
    --primary: #0a66c2;
    --primary-hover: #084d91;
    --bg: #ffffff;
    --text: #1e293b;
    --text-muted: #475569;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --container: 1100px;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Layout */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

header, #main-header {
    background: var(--white);
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    min-height: 77px;
    display: block;
    overflow: hidden; /* Prevents ads from expanding the header container */
}

/* AdSense Header Fix */
header ins, #main-header ins, 
header iframe, #main-header iframe {
    display: none !important;
    height: 0 !important;
}


header .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--text);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav ul li a {
    font-weight: 500;
    transition: color 0.2s;
}

nav ul li a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    text-align: center;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 2rem;
}

/* Tool Grid */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0 4rem;
}

.tool-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tool-card .icon {
    width: 64px;
    height: 64px;
    background: #eff6ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--primary);
}

.tool-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.tool-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Buttons - Centered for PC */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    min-width: 160px;
}

.btn:hover {
    background-color: var(--primary-hover);
}

.btn:active {
    transform: scale(0.98);
}

.btn-center-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Tool Workspace */
.workspace {
    padding: 2rem 0;
    margin-bottom: 3rem;
}

.drop-zone {
    border: 2px dotted #475569; /* Darker dotted border */
    padding: 3rem 2rem;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: #eff6ff;
    transform: scale(1.01);
}

.drop-zone .upload-icon {
    width: 64px;
    height: 64px;
    background: #eff6ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.drop-zone p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.drop-zone span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.drop-zone.active {
    background: #eff6ff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.1);
}

/* Cropper Container */
#cropper-container {
    max-width: 450px;
    height: 350px; /* Fixed height to contain the cropper */
    margin: 2rem auto 0;
    display: none;
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.img-preview {
    max-width: 100%;
    height: 100%; /* Take full height of parent */
    display: block;
}

#result-img {
    max-width: 200px;
    max-height: 250px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    margin: 1rem 0;
}

/* Controls */
.controls {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 400px;
}

.input-group label {
    font-weight: 600;
    font-size: 0.9rem;
}

.input-group input {
    padding: 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

/* Content Area */
.seo-content {
    padding: 2rem 0;
    margin-bottom: 4rem;
}

.seo-content h2 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    color: var(--text);
    font-weight: 800;
}

.seo-content h3 {
    font-size: 1.75rem;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: var(--text);
}

.seo-content p {
    margin-bottom: 1.5rem;
    color: #334155;
    font-size: 1.1rem;
}

.seo-content ul, .seo-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem; /* Indent bullets from the left */
}

.seo-content li {
    margin-bottom: 0.75rem;
    color: #334155;
    font-size: 1.1rem;
}

/* Footer */
footer, #main-footer {
    background: #ffffff;
    color: var(--text);
    padding: 5rem 0 3rem;
    border-top: 1px solid #e2e8f0;
    min-height: 450px;
    display: block;
}

.footer-section h4 {
    color: var(--text);
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    color: var(--text-muted);
    transition: all 0.3s;
    font-size: 0.95rem;
}

.footer-section ul li a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid #e2e8f0;
    padding-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Resource Box Utility */
.resource-box {
    background: #ffffff;
    border-left: 5px solid var(--primary);
    padding: 1.5rem;
    margin: 2.5rem 0;
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 1rem;
    line-height: 1.6;
}

.resource-box strong {
    color: var(--primary);
}

.resource-box a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
}

/* Related Tools Section */
.related-tools {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid #e2e8f0;
}

.related-tools h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background: #fff;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none !important;
}

.related-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.related-card .icon-sm {
    width: 44px;
    height: 44px;
    background: #eff6ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.related-card h4 {
    font-size: 1rem;
    color: var(--text);
    margin: 0;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    nav ul {
        display: none; /* Mobile menu logic can be added */
    }
    .hero h1 {
        font-size: 2rem;
    }
    .workspace {
        padding: 1.5rem;
    }
    .related-grid {
        grid-template-columns: 1fr 1fr;
    }
}
