/**
 * Drawing Feature Styles
 * お絵描き機能のスタイル定義
 */

/* ========================================
   Drawing Introduction Section
   ======================================== */

.drawing-section {
    text-align: center;
    margin: 60px 0;
}

.drawing-intro {
    border: 2px solid #DDCDBF;
    padding: 40px;
    max-width: 600px;
    margin: 0 auto;
    background-color: #ffffff;
}

.drawing-intro h3 {
    font-size: 1.4rem;
    font-weight: 300;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
    color: rgb(70, 72, 88);
}

.drawing-intro p {
    font-size: 1rem;
    font-weight: 300;
    margin-bottom: 12px;
    line-height: 1.6;
}

.drawing-intro p:last-child {
    margin-bottom: 0;
}

/* Notice Box */
.notice-box {
    margin: 20px 0;
    padding: 15px;
    background-color: rgba(221, 205, 191, 0.1);
    border: 1px solid #DDCDBF;
}

.notice-box p {
    font-size: var(--min-font-size, 1.125rem);
    font-weight: 300;
    line-height: 1.6;
    margin: 0;
}

.notice-box a {
    color: rgb(113, 175, 182);
    text-decoration: underline;
}

.notice-box a:hover {
    color: rgb(95, 155, 162);
}

/* ========================================
   Button Container
   ======================================== */

.button-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* ========================================
   Drawing Buttons
   ======================================== */

.drawing-start-btn,
.gallery-link-btn {
    background-color: rgb(113, 175, 182);
    color: #ffffff;
    padding: 12px 30px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 300;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.drawing-start-btn:hover,
.gallery-link-btn:hover {
    background-color: rgb(95, 155, 162);
    transform: translateY(-2px);
    text-decoration: none;
    color: #ffffff;
}

/* ========================================
   Gallery Link Section
   ======================================== */

.gallery-link-section {
    text-align: center;
    margin: 60px 0;
    padding: 40px;
    background-color: rgba(221, 205, 191, 0.1);
    border: 2px solid #DDCDBF;
}

.gallery-link-section h3 {
    font-size: 1.4rem;
    font-weight: 300;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    color: rgb(70, 72, 88);
}

.gallery-link-section p {
    font-size: 1rem;
    font-weight: 300;
    margin-bottom: 25px;
    line-height: 1.6;
}

.gallery-link-btn-bottom {
    background-color: rgb(113, 175, 182);
    color: #ffffff;
    padding: 12px 30px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 300;
    transition: all 0.3s ease;
    display: inline-block;
}

.gallery-link-btn-bottom:hover {
    background-color: rgb(95, 155, 162);
    transform: translateY(-2px);
    text-decoration: none;
    color: #ffffff;
}

/* ========================================
   Drawings Gallery Section
   ======================================== */

.drawings-gallery {
    margin: 60px 0;
}

.drawings-gallery h3 {
    font-size: 1.4rem;
    font-weight: 300;
    text-align: center;
    margin-bottom: 30px;
    letter-spacing: 0.5px;
    color: rgb(70, 72, 88);
}

.no-drawings {
    text-align: center;
    padding: 40px;
    border: 2px solid #DDCDBF;
    background-color: #ffffff;
}

.no-drawings p {
    font-size: 1rem;
    font-weight: 300;
    color: #666666;
    line-height: 1.6;
}

.drawings-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.drawing-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    padding: 30px;
    border: 3px solid #DDCDBF;
    background-color: #ffffff;
    position: relative;
    overflow: hidden;
}

.drawing-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgb(113, 175, 182);
}

.drawing-image {
    width: 100%;
    max-width: 800px;
    height: 500px;
    overflow: hidden;
    background-color: #ffffff;
}

.drawing-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ========================================
   Drawing Header
   ======================================== */

.drawing-header {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

.drawing-title {
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
    color: #555555;
    line-height: 1.3;
}

.drawing-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.drawing-header .drawing-author {
    font-size: var(--min-font-size, 1.125rem);
    font-weight: 400;
    color: #555555;
    margin: 0;
    margin-right: 10px;
}

.drawing-header .drawing-date {
    font-size: var(--min-font-size, 1.125rem);
    font-weight: 300;
    color: #999999;
    margin: 0;
}

.drawing-info {
    width: 100%;
    text-align: center;
}

.drawing-info h4 {
    font-size: 1.6rem;
    font-weight: 400;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
    color: #333333;
    line-height: 1.3;
}

.drawing-author {
    font-size: 1.1rem;
    font-weight: 500;
    color: rgb(95, 155, 162);
    margin: 10px 0;
    font-style: italic;
}

.drawing-date {
    font-size: var(--min-font-size, 1.125rem);
    font-weight: 300;
    color: #888888;
    margin: 0;
}

/* ========================================
   Comments Section
   ======================================== */

.comments-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #DDCDBF;
    width: 100%;
}

.comments-section h5 {
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
    color: rgb(70, 72, 88);
}

.comments-list {
    margin-bottom: 20px;
}

.no-comments {
    font-size: var(--min-font-size, 1.125rem);
    font-weight: 300;
    color: #999999;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background-color: rgba(221, 205, 191, 0.1);
    margin: 0;
}

.comment-item {
    padding: 15px;
    margin-bottom: 10px;
    background-color: rgba(221, 205, 191, 0.1);
}

.comment-item:last-child {
    margin-bottom: 0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    font-size: var(--min-font-size, 1.125rem);
    font-weight: 700;
    color: rgb(113, 175, 182);
}

.comment-author::after {
    content: ":";
    margin-left: 2px;
}

.comment-date {
    font-size: var(--min-font-size, 1.125rem);
    font-weight: 300;
    color: #999999;
}

.comment-text {
    font-size: var(--min-font-size, 1.125rem);
    font-weight: 300;
    color: #333333;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    text-align: left;
}

/* ========================================
   View More Comments Link
   ======================================== */

.view-more-comments {
    margin-top: 15px;
    text-align: center;
}

.view-more-link {
    color: rgb(113, 175, 182);
    text-decoration: underline;
    font-size: var(--min-font-size, 1.125rem);
    font-weight: 300;
}

.view-more-link:hover {
    color: rgb(95, 155, 162);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .drawing-section {
        margin: 40px 0;
    }

    .drawing-intro {
        padding: 30px 20px;
    }

    .button-container {
        flex-direction: column;
        align-items: center;
    }

    .drawing-start-btn,
    .gallery-link-btn {
        width: 100%;
        max-width: 300px;
    }

    .gallery-link-section {
        padding: 30px 20px;
        margin: 40px 0;
    }

    .drawings-gallery {
        margin: 40px 0;
    }

    .drawing-item {
        padding: 20px;
    }

    .drawing-image {
        height: 300px;
    }

    .drawing-meta {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }

    .drawing-header .drawing-author,
    .drawing-header .drawing-date {
        margin: 0;
    }

    /* コメント機能のレスポンシブ */
    .comment-form {
        padding: 15px;
    }

    .comment-item {
        padding: 10px;
    }

    .comment-header {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }

    .comment-author {
        font-weight: 600;
    }

    .comment-date {
        text-align: left;
        font-size: var(--min-font-size, 1.125rem);
    }
}

@media (max-width: 480px) {
    .drawing-intro {
        padding: 20px 15px;
    }

    .drawing-intro h3 {
        font-size: 1.2rem;
    }

    .drawing-intro p {
        font-size: var(--min-font-size, 1.125rem);
    }

    .notice-box {
        padding: 10px;
    }

    .notice-box p {
        font-size: var(--min-font-size, 1.125rem);
    }

    .drawing-start-btn,
    .gallery-link-btn,
    .gallery-link-btn-bottom {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .gallery-link-section {
        padding: 20px 15px;
    }

    .drawing-item {
        padding: 15px;
    }

    .drawing-image {
        height: 250px;
    }

    .drawing-title {
        font-size: 1.2rem;
    }
}

/* ========================================
   Drawing Canvas Section
   ======================================== */

.drawing-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.back-link {
    background-color: #95a5a6;
    color: #ffffff;
    padding: 10px 20px;
    text-decoration: none;
    font-size: var(--min-font-size, 1.125rem);
    font-weight: 300;
    transition: all 0.3s ease;
}

.back-link:hover {
    background-color: #7f8c8d;
    text-decoration: none;
    color: #ffffff;
}

.save-btn {
    background-color: rgb(113, 175, 182);
    color: #ffffff;
    padding: 10px 20px;
    text-decoration: none;
    font-size: var(--min-font-size, 1.125rem);
    font-weight: 300;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.save-btn:hover {
    background-color: rgb(95, 155, 162);
    text-decoration: none;
    color: #ffffff;
}

.drawing-canvas-container {
    margin-bottom: 40px;
}

/* ========================================
   Drawing Toolbar
   ======================================== */

.drawing-toolbar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background-color: #ffffff;
    border: 2px solid #DDCDBF;
    margin-bottom: 20px;
}

.toolbar-top {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.toolbar-bottom {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.tool-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background-color: rgba(221, 205, 191, 0.1);
    border: 1px solid #DDCDBF;
}

.tool-section.tools-section {
    justify-content: center;
}

.tools-section {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 90px;
    align-items: center;
}

.tool-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.sliders-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 60px;
    flex: 1;
    min-width: 200px;
}

.actions-section {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    width: 212px;
}

.zoom-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 60px;
    flex: 1;
    min-width: 200px;
}

.slider-group {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.slider-group label {
    font-size: var(--min-font-size, 1.125rem);
    font-weight: 300;
    min-width: 80px;
    color: #333333;
    flex-shrink: 0;
}

.wide-slider {
    flex: 1;
    min-width: 0;
}

.slider-group span {
    font-size: var(--min-font-size, 1.125rem);
    font-weight: 300;
    min-width: 50px;
    text-align: right;
    color: #333333;
    flex-shrink: 0;
}

.tool-btn {
    padding: 8px;
    border: 2px solid #DDCDBF;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-btn:hover {
    background-color: rgba(113, 175, 182, 0.1);
    border-color: rgb(113, 175, 182);
}

.tool-btn.active {
    background-color: rgb(113, 175, 182);
    border-color: rgb(95, 155, 162);
    color: #ffffff;
}

.tool-btn svg {
    width: 20px;
    height: 20px;
}

.color-picker-btn {
    position: relative;
}

.color-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    padding: 0;
    margin: 0;
    border: none;
}

/* ========================================
   Canvas Wrapper
   ======================================== */

.canvas-wrapper {
    width: 860px;
    height: 600px;
    overflow: auto;
    background-color: #f5f5f5;
    border: 2px solid #DDCDBF;
    padding: 20px;
    margin: 0 auto;
}

.canvas-wrapper.drag-enabled {
    cursor: grab;
}

.canvas-wrapper.dragging {
    cursor: grabbing;
}

#drawingCanvasElement {
    display: block;
    margin: 0 auto;
    background-color: #ffffff;
    border: 1px solid #DDCDBF;
}

/* ========================================
   Responsive Design - Canvas
   ======================================== */

@media (max-width: 768px) {
    .drawing-navigation {
        flex-direction: row;
        gap: 10px;
        text-align: left;
        margin-bottom: 15px;
        flex-wrap: wrap;
    }
    
    .back-link {
        font-size: var(--min-font-size, 1.125rem);
        padding: 8px 12px;
        width: 120px;
        text-align: center;
    }
    
    .save-btn {
        font-size: var(--min-font-size, 1.125rem);
        padding: 8px 12px;
        width: 120px;
        text-align: center;
    }
    
    .drawing-toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        width: 100%;
        max-width: 100%;
        padding: 15px;
    }
    
    .toolbar-top {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        justify-content: flex-start;
    }
    
    .tools-section {
        min-height: auto;
    }
    
    .toolbar-bottom {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        justify-content: flex-start;
    }
    
    .tool-section {
        padding: 8px;
    }
    
    .slider-group {
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .slider-group label {
        min-width: 60px;
        font-size: var(--min-font-size, 1.125rem);
    }
    
    .wide-slider {
        min-width: 80px;
        max-width: none;
        flex: 1;
    }
    
    .actions-section {
        width: 100%;
        justify-content: center;
    }
    
    .tool-btn {
        min-width: 36px;
        min-height: 36px;
        padding: 6px;
    }
    
    .tool-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .canvas-wrapper {
        width: 100%;
        height: 500px;
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .toolbar-top {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .tools-section {
        min-height: auto;
    }
    
    .sliders-section {
        min-height: auto;
    }
    
    .wide-slider {
        min-width: 60px;
        max-width: none;
    }
    
    .actions-section {
        width: auto;
    }
}

@media (max-width: 480px) {
    .drawing-toolbar {
        padding: 10px;
        gap: 10px;
    }
    
    .toolbar-top {
        gap: 10px;
    }
    
    .toolbar-bottom {
        gap: 10px;
    }
    
    .tool-section {
        padding: 2px 4px;
    }
    
    .slider-group {
        gap: 3px;
        flex-wrap: nowrap;
    }
    
    .slider-group label {
        min-width: 50px;
        font-size: var(--min-font-size, 1.125rem);
    }
    
    .wide-slider {
        min-width: 40px;
        flex: 1;
    }
    
    .tool-btn {
        min-width: 32px;
        min-height: 32px;
        padding: 4px;
    }
    
    .tool-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .canvas-wrapper {
        width: 100%;
        height: 400px;
        max-width: 100%;
        padding: 10px;
    }
}

/* ========================================
   Preview Section
   ======================================== */

.preview-section {
    margin: 60px 0;
}

.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.preview-image-container {
    background-color: #ffffff;
    border: 2px solid #DDCDBF;
    padding: 20px;
}

.preview-image-container h3 {
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    color: rgb(70, 72, 88);
    text-align: center;
}

.preview-image-wrapper {
    display: flex;
    justify-content: center;
    background-color: #ffffff;
    padding: 20px;
    overflow: auto;
}

#previewCanvas {
    border: 1px solid #DDCDBF;
    background-color: #ffffff;
    max-width: 100%;
    height: auto;
}

.upload-form-container {
    background-color: #ffffff;
    border: 2px solid #DDCDBF;
    padding: 30px;
}

.upload-form-container h3 {
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
    color: rgb(70, 72, 88);
    text-align: center;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-form .form-group {
    margin-bottom: 0;
}

.upload-form label {
    display: block;
    font-size: 1rem;
    font-weight: 300;
    color: #333333;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.upload-form input,
.upload-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #DDCDBF;
    font-size: 1rem;
    font-weight: 300;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.upload-form input:focus,
.upload-form textarea:focus {
    outline: none;
    border-color: rgb(113, 175, 182);
}

.upload-form textarea {
    height: 120px;
    resize: vertical;
    min-height: 100px;
}

.char-count {
    text-align: right;
    font-size: var(--min-font-size, 1.125rem);
    color: #666666;
    margin-top: 5px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

.btn {
    padding: 10px 20px;
    font-size: var(--min-font-size, 1.125rem);
    font-weight: 300;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary {
    background-color: #95a5a6;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
    color: #ffffff;
}

.btn-primary {
    background-color: rgb(113, 175, 182);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: rgb(95, 155, 162);
    color: #ffffff;
}

/* ========================================
   Responsive Design - Preview
   ======================================== */

@media (max-width: 768px) {
    .preview-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .preview-image-container,
    .upload-form-container {
        padding: 20px;
    }
    
    .upload-form input,
    .upload-form textarea {
        font-size: 16px; /* iOSでのズーム防止 */
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
    }
}
