/* Modern styling for the entire dashboard */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #202124;
}

/* Header styling */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #2d3748;
    padding: 1.25rem 2rem;
    border-radius: 0;
    margin-bottom: 0;
    margin-top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.header p {
    margin: 0;
    color: #4a5568;
}

.header a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.header a:hover {
    color: #764ba2;
}

#back-button {
    cursor: pointer;
    color: #667eea;
    font-weight: 600;
    transition: all 0.2s ease;
}

#back-button:hover {
    color: #764ba2;
    transform: translateX(-3px);
}

/* Dashboard container */
.dashboard-container {
    width: 100%;
    max-width: 900px;
    margin: 2rem auto;
    background-color: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.dashboard-border {
    border: none;
}

/* Dashboard title */
.dashboard-title {
    text-align: center;
    margin: 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Dashboard tiles */
.dashboard-tile {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: auto;
}

.dashboard-tile:hover {
    background-color: #f7fafc;
    transform: translateX(5px);
}

.dashboard-tile:last-child {
    border-bottom: none;
}

.dashboard-image-div {
    margin-right: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dashboard-image {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dashboard-image-div p {
    margin: 0;
    font-size: 0.75rem;
    color: #718096;
    font-weight: 500;
}

.dashboard-rest-div {
    flex: 1;
    min-width: 0;
}

.dashboard-tile h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-tile p {
    margin: 0;
    font-size: 0.9rem;
    color: #718096;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dashboard-tile .timestamp {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-bottom: 0.5rem;
    display: block;
}

/* Floating button */
.floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    height: 60px;
    width: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b9ce8 0%, #8466a3 100%);
    font-size: 2rem;
    color: white;
    padding: 0;
    margin: 0;
    line-height: 60px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    border: none;
    text-align: center;
}

.floating:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.floating:active {
    transform: translateY(-2px) scale(1.02);
}

/* New story form styling */
#newstory {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 3rem;
    max-width: 900px;
    width: calc(100% - 4rem);
    margin: 2rem auto;
}

#newstory h1 {
    color: #2d3748;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#newstory h3 {
    color: #4a5568;
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

#newstory p, #newstory ul {
    color: #718096;
    line-height: 1.6;
    margin-bottom: 1rem;
}

#newstory input[type="file"] {
    cursor: pointer;
}

.input-elem {
    display: block;
    width: 95%;
    padding: 1.5rem;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    background: #f7fafc;
    transition: all 0.3s ease;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.input-elem:hover {
    border-color: #667eea;
    background: #edf2f7;
    transform: translateY(-2px);
}

#image-picker {
    min-height: 50px;
    margin: 1rem 0;
    display: table-row;
    gap: 1rem;
    flex-wrap: wrap;
}

.image-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-container img {
    display: block;
    max-width: 150px;
    max-height: 150px;
    object-fit: cover;
}

.image-container input[type="checkbox"] {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #667eea;
}

#newstory textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
    margin: 1rem 0;
    box-sizing: border-box;
}

#newstory textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#newstory input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
    margin-right: 0.5rem;
}

.prompt-box {
    margin: 2rem 0;
}

#newstory button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    width: 100%;
}

#newstory button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

#newstory button:active {
    transform: translateY(-1px);
}

#edit_instr {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 1rem;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    margin: 1rem 0;
    color: #4a5568;
}

#promptSent {
    color: #48bb78;
    font-weight: 500;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(72, 187, 120, 0.1);
    border-radius: 8px;
}

.output {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    min-height: 100px;
    color: #4a5568;
    line-height: 1.6;
}

#newstory span[onclick*="closeNewStory"] {
    color: #667eea;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    display: inline-block;
    margin-top: 1rem;
    transition: color 0.2s ease;
}

#newstory span[onclick*="closeNewStory"]:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
        flex-wrap: wrap;
    }

    .header h2 {
        font-size: 1.2rem;
    }

    .dashboard-container {
        margin: 1rem;
        border-radius: 12px;
    }

    .dashboard-tile {
        padding: 1rem;
    }

    .dashboard-image-div {
        margin-right: 1rem;
    }

    .dashboard-image {
        width: 50px;
        height: 50px;
    }

    .dashboard-image-div p {
        display: none;
    }

    .dashboard-tile .timestamp {
        display: inline;
        margin-right: 0.5rem;
    }

    .dashboard-tile h3 {
        display: inline;
        font-size: 1rem;
    }

    #newstory {
        padding: 1.5rem;
        margin: 1rem;
        width: calc(100% - 2rem);
    }

    #newstory h1 {
        font-size: 1.5rem;
    }

    #newstory textarea {
        font-size: 0.95rem;
    }

    .floating {
        bottom: 1.5rem;
        right: 1.5rem;
        height: 50px;
        width: 50px;
        font-size: 1.8rem;
        line-height: 50px;
    }
}

/* Old styles preserved for compatibility */
.nameSelect {
    color: #667eea;
    font-size: 1em;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

.nameSelect:hover {
    color: #764ba2;
}

.s_image {
    max-width: 256px;
    max-height: 256px;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.s_image:hover {
    transform: scale(1.05);
}

.s_image_full {
    max-width: 100%;
    max-height: 100%;
    cursor: pointer;
    border-radius: 8px;
}

#newstorymsg {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#newstorymsg em {
    color: #4a5568;
    font-style: normal;
}

.clickspan {
    color: #00f;
    font-size:1em;
    text-decoration: underline;
    cursor:pointer
  }

#story-container {
    padding: 15px;
}

#advanced-options {
    display:none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.error-icon, .error-text {
    display: none;
}
