/* -----------------------------------------------------
   GLOBAL STYLES
----------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #2b7cff;
    --primary-hover: #1e63d0;
    --dark: #1c1c1c;
    --text: #222;
    --muted: #666;
    --border: #e7e7e7;
    --card-bg: rgba(255, 255, 255, 0.8);
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 8px 25px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f3f6ff, #ffffff);
    color: var(--text);
    padding-bottom: 40px;
}

img {
    max-width: 100%;
    display: block;
}

/* Perfect circle support */
.face-circle {
  border-radius: 50%;
  object-fit: cover;
}

/* -----------------------------------------------------
   HEADER
----------------------------------------------------- */

header {
    background: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 99;
}

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

header h1 {
    font-size: 22px;
    font-weight: 700;
}

header a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    transition: 0.2s;
}

header a:hover {
    color: var(--primary-hover);
}

/* -----------------------------------------------------
   MAIN LAYOUT
----------------------------------------------------- */

.container {
    width: 100%;
    max-width: 1300px;
    margin: 30px auto;
    padding: 0 20px;
}

h2 {
    font-size: 24px;
    margin-bottom: 16px;
    font-weight: 600;
}

h3 {
    margin-top: 20px;
    margin-bottom: 10px;
}

/* -----------------------------------------------------
   BUTTONS
----------------------------------------------------- */

.btn {
    display: inline-block;
    padding: 10px 18px;
    background: var(--primary);
    color: #fff !important;
    border-radius: var(--radius);
    font-weight: 500;
    text-decoration: none;
    transition: 0.2s ease;
    cursor: pointer;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* -----------------------------------------------------
   GRID (index.php templates)
----------------------------------------------------- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 28px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: var(--shadow);
    transition: 0.25s ease;
    border: 1px solid rgba(255,255,255,0.4);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.15);
}

.card img {
    height: 190px;
    border-radius: var(--radius);
    object-fit: cover;
}

.card h3 {
    margin: 12px 0 4px;
    font-size: 18px;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

/* -----------------------------------------------------
   FORMS
----------------------------------------------------- */

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

input[type=text],
input[type=password],
input[type=number],
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 4px;
    margin-bottom: 12px;
    font-size: 14px;
}

input[type=file] {
    margin: 6px 0 12px;
}

textarea { resize: vertical; }

hr {
    border: none;
    border-bottom: 1px solid var(--border);
    margin: 20px 0;
}

/* -----------------------------------------------------
   NEW EDITOR LAYOUT (Re-designed)
----------------------------------------------------- */

.editor {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    margin-top: 20px;
    flex-wrap: nowrap;
}

.editor-left {
    flex: 1.2;
    max-width: 700px;
    display: flex;
    justify-content: center;
}

.editor-right {
    flex: 1;
    max-width: 380px;
}

.canvas {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #fff;
    padding: 10px;
}

.faceControl {
    background: #fff;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    margin-bottom: 18px;
}

/* Range slider */
input[type=range] {
    width: 100%;
    margin-top: 6px;
}

/* -----------------------------------------------------
   RESPONSIVE DESIGN
----------------------------------------------------- */

/* Tablet */
@media (max-width: 1000px) {
    .editor {
        flex-wrap: wrap;
        text-align: center;
    }

    .editor-left,
    .editor-right {
        max-width: 100%;
    }

    .editor-right {
        margin-top: 30px;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .editor {
        flex-direction: column;
        align-items: center;
    }

    .editor-left {
        width: 100%;
    }

    .editor-right {
        width: 100%;
    }

    .canvas {
        margin: 0 auto;
    }
}
