/* Global Vars - Kindergarten Theme */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300;400;500;600;700&display=swap');

:root {
    /* Palette */
    --color-bg: #E0F7FA;
    /* Light Blue BG */
    --color-card: #FFFFFF;

    --color-primary: #FF6B6B;
    /* Playful Red/Pink */
    --color-primary-hover: #FF5252;

    --color-secondary: #4ECDC4;
    /* Mint/Teal */
    --color-secondary-hover: #45B7AF;

    --color-accent: #FFE66D;
    /* Sunshine Yellow */
    --color-text-main: #2D3436;
    /* Soft Black */
    --color-text-muted: #636E72;

    --color-success: #6BCB77;
    /* Soft Green */
    --color-danger: #FF6B6B;

    --border-radius-lg: 20px;
    --border-radius-md: 15px;
    --border-radius-sm: 10px;

    --shadow-pop: 0 4px 0 rgba(0, 0, 0, 0.1);
    --shadow-card: 0 8px 24px rgba(149, 157, 165, 0.2);
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Fredoka', ui-sans-serif, system-ui, sans-serif;
    line-height: 1.6;
    color: var(--color-text-main);
    background-color: var(--color-bg);
    background-image:
        radial-gradient(#4ECDC4 20%, transparent 20%),
        radial-gradient(#FF6B6B 20%, transparent 20%);
    background-size: 50px 50px;
    background-position: 0 0, 25px 25px;
}

/* Utilities */
.hidden {
    display: none !important;
}

.block {
    display: block;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.relative {
    position: relative;
}

.text-center {
    text-align: center;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.cursor-pointer {
    cursor: pointer;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.25rem;
}

.text-md {
    font-size: 1rem;
}

.bg-light {
    background-color: #F7F9FC;
}

/* Colors */
.text-red-500 {
    color: var(--color-danger);
}

.text-green-500 {
    color: var(--color-success);
}

.text-blue-500 {
    color: var(--color-secondary);
}

.text-gray-500 {
    color: var(--color-text-muted);
}

/* Components */

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    /* Pill shape */
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Fredoka', sans-serif;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-pop);
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
}

.btn-upload {
    background-color: var(--color-secondary);
    color: white;
}

.btn-upload:hover {
    background-color: var(--color-secondary-hover);
    transform: translateY(-2px);
}

.btn-delete {
    background: none;
    border: none;
    color: var(--color-danger);
    font-weight: bold;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    transition: transform 0.2s;
}

.btn-delete:hover {
    transform: scale(1.2);
    color: #b91c1c;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    color: var(--color-text-main);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--color-text-main);
    background-color: #fff;
    border: 3px solid #E0E0E0;
    border-radius: var(--border-radius-md);
    font-family: 'Fredoka', sans-serif;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.2);
}

/* Admin Specifics */
.admin-body {
    min-height: 100vh;
    padding: 2rem;
}

.admin-container {
    max-width: 95%;
    margin: 0 auto;
}

.admin-title {
    font-size: 2.5rem;
    color: #FF6B6B;
    text-shadow: 2px 2px 0px #FFE66D;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .admin-grid {
        grid-template-columns: 3fr 2fr;
        align-items: start;
    }
}

.admin-card {
    background-color: var(--color-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-card);
    padding: 2rem;
    border: 4px solid #fff;
    /* Border matching card to pop from bg */
}

/* Tabs */
.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: none;
}

.nav-tab {
    padding: 0.75rem 2rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text-muted);
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 50px;
    border: 2px solid transparent;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.nav-tab:hover {
    background-color: #fff;
    transform: translateY(-2px);
    color: var(--color-text-main);
}

.nav-tab.active {
    background-color: var(--color-accent);
    color: var(--color-text-main);
    box-shadow: var(--shadow-pop);
    border-color: #fff;
    transform: scale(1.05);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}


/* History */
.media-history-container {
    overflow-x: auto;
    border-radius: var(--border-radius-md);
    border: 2px solid #f0f0f0;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    text-align: left;
    padding: 1rem;
    background-color: #FFE66D;
    /* Yellow Header */
    color: var(--color-text-main);
    font-weight: 700;
}

.history-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.history-table tr:hover {
    background-color: #fafafa;
}

.history-table tr.selected {
    background-color: #E0F7FA;
    border-left: 4px solid var(--color-secondary);
}

/* Audio Item */
.audio-item {
    background-color: #fff;
    padding: 1rem;
    border-radius: var(--border-radius-md);
    border: 2px solid #F0F0F0;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.audio-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.audio-sender {
    font-weight: 700;
    color: var(--color-secondary);
}

.btn-icon-delete {
    background: none;
    border: none;
    color: var(--color-danger);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: background 0.2s;
}

.btn-icon-delete:hover {
    background-color: #ffe5e5;
}

/* Login/Client Sim */
.client-body {
    background-color: var(--color-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.device-frame {
    background-color: #fff;
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 8px solid #FF6B6B;
    max-width: 28rem;
    width: 100%;
}

.app-header {
    background-color: #FF6B6B;
    padding: 1.5rem;
    text-align: center;
    color: white;
}

.content-area {
    padding: 2rem;
    background-color: #fff;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* PIN */
.pin-container {
    display: flex;
    justify-content: center;
}

.pin-digit {
    width: 3.5rem;
    height: 3.5rem;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    border: 3px solid #E0E0E0;
    border-radius: 15px;
    margin: 0 0.25rem;
    color: var(--color-primary);
}

.pin-digit:focus {
    outline: none;
    border-color: var(--color-accent);
    transform: scale(1.1);
}

/* Table Images */
.table-thumb {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    background: #E0E0E0;
}

.table-icon-placeholder {
    width: 60px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    color: #6b7280;
    border-radius: 4px;
}

/* Other */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.rounded-full {
    border-radius: 9999px;
}

.bg-gray-50 {
    background-color: #f9fafb;
}

.border {
    border-width: 1px;
}

/* Status */
.status-msg {
    margin-top: 1rem;
    text-align: center;
    font-weight: 600;
}

/* Switch/Toggle Container */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--color-secondary);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--color-secondary);
}

input:checked+.slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Preview */
.preview-media {
    max-width: 100%;
    border-radius: var(--border-radius-md);
    margin-top: 1rem;
    border: 4px solid #E0E0E0;
}